From 7be0950b7d14046d05fa308980f37e7fdb7f527e Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Tue, 17 Apr 2012 23:23:35 +0200 Subject: [PATCH] portability: Don't compare signed and unsigned integers --- conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.3