From: Joel Rosdahl Date: Tue, 17 Apr 2012 21:23:35 +0000 (+0200) Subject: portability: Don't compare signed and unsigned integers X-Git-Tag: v3.2~141 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7be0950b7d14046d05fa308980f37e7fdb7f527e;p=thirdparty%2Fccache.git portability: Don't compare signed and unsigned integers --- diff --git a/conf.c b/conf.c index 6c248534e..5dcd640a5 100644 --- a/conf.c +++ b/conf.c @@ -142,7 +142,7 @@ parse_unsigned(const char *str, void *result, char **errmsg) char *endptr; errno = 0; x = strtol(str, &endptr, 10); - if (errno == 0 && x >= 0 && x <= (unsigned)-1 && *str != '\0' + if (errno == 0 && x >= 0 && x <= (long)(unsigned)-1 && *str != '\0' && *endptr == '\0') { *value = x; return true;