Browse Source

Fix building warnings on Cygwin

pull/1026/head
Max Lv 8 years ago
parent
commit
2f3eb4c11e
3 changed files with 6 additions and 4 deletions
  1. 4
      src/acl.c
  2. 2
      src/http.c
  3. 4
      src/utils.c

4
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

2
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);

4
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(

Loading…
Cancel
Save