diff --git a/src/acl.c b/src/acl.c index d790f401..15b9ffaa 100644 --- a/src/acl.c +++ b/src/acl.c @@ -343,7 +343,7 @@ trimwhitespace(char *str) char *end; // Trim leading space - while (isspace(*str)) + while (isspace((unsigned char)*str)) str++; if (*str == 0) // All spaces? @@ -351,7 +351,7 @@ trimwhitespace(char *str) // Trim trailing space end = str + strlen(str) - 1; - while (end > str && isspace(*end)) + while (end > str && isspace((unsigned char)*end)) end--; // Write new null terminator diff --git a/src/http.c b/src/http.c index 3bd4a322..607b99a9 100644 --- a/src/http.c +++ b/src/http.c @@ -103,7 +103,7 @@ get_header(const char *header, const char *data, int data_len, char **value) while ((len = next_header(&data, &data_len)) != 0) if (len > header_len && strncasecmp(header, data, header_len) == 0) { /* Eat leading whitespace */ - while (header_len < len && isblank(data[header_len])) + while (header_len < len && isblank((unsigned char)data[header_len])) header_len++; *value = malloc(len - header_len + 1); diff --git a/src/utils.c b/src/utils.c index c7fc6513..317c7a7b 100644 --- a/src/utils.c +++ b/src/utils.c @@ -92,7 +92,7 @@ int ss_isnumeric(const char *s) { if (!s || !*s) return 0; - while (isdigit(*s)) + while (isdigit((unsigned char)*s)) ++s; return *s == '\0'; } @@ -140,10 +140,12 @@ run_as(const char *user) return 0; } +#ifndef __CYGWIN__ if (initgroups(pwd->pw_name, pwd->pw_gid) == -1) { LOGE("Could not change supplementary groups for user '%s'.", pwd->pw_name); return 0; } +#endif if (setuid(pwd->pw_uid) != 0) { LOGE(