mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-25 02:03:42 +00:00
Fix building warnings on Cygwin
This commit is contained in:
@@ -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
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
+3
-1
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user