From caea098c2191a2d94a28e90bfef958c34473a5a4 Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Sat, 26 Sep 2009 00:58:42 +0200 Subject: cygwin fix : use unsigned char for ctype function See http://www.nabble.com/-PATCH-RFA--Distinguish-between-EOF-and-character-with-value-0xff-td23161772.html#a23188494 cygwin 1.7 actually displays a warning when using signed char with the ctype function, so that compilation fails when using -Wall -Werror. So we just cast all arguments to unsigned char. Signed-off-by: Xavier Chantry Signed-off-by: Dan McGee --- src/pacman/util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/pacman/util.c b/src/pacman/util.c index 0351556e..da2000ea 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -297,7 +297,7 @@ char *strtoupper(char *str) char *ptr = str; while(*ptr) { - (*ptr) = toupper(*ptr); + (*ptr) = toupper((unsigned char)*ptr); ptr++; } return str; @@ -314,7 +314,7 @@ char *strtrim(char *str) return(str); } - while(isspace(*pch)) { + while(isspace((unsigned char)*pch)) { pch++; } if(pch != str) { @@ -327,7 +327,7 @@ char *strtrim(char *str) } pch = (str + (strlen(str) - 1)); - while(isspace(*pch)) { + while(isspace((unsigned char)*pch)) { pch--; } *++pch = '\0'; -- cgit v1.2.3-70-g09d2