From: Andrew Morton Date: Thu, 13 Sep 2012 01:01:11 +0000 (+1000) Subject: lib-parserc-avoid-overflow-in-match_number-fix X-Git-Tag: next-20120917~4^2~85 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=99896ac279268b341e741af37c6847ede40b7365;p=karo-tx-linux.git lib-parserc-avoid-overflow-in-match_number-fix coding-style tweaks Cc: Alex Elder Signed-off-by: Andrew Morton --- diff --git a/lib/parser.c b/lib/parser.c index 2499cb87774c..52cfa69f73df 100644 --- a/lib/parser.c +++ b/lib/parser.c @@ -142,7 +142,7 @@ static int match_number(substring_t *s, int *result, int base) val = simple_strtol(buf, &endp, base); if (endp == buf) ret = -EINVAL; - else if (val < (long) INT_MIN || val > (long) INT_MAX) + else if (val < (long)INT_MIN || val > (long)INT_MAX) ret = -ERANGE; else *result = (int) val;