From 7cfa20c51ab364005fb95cca1ed5e37b0eb9ff61 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Thu, 13 Sep 2012 11:01:11 +1000 Subject: [PATCH] lib-parserc-avoid-overflow-in-match_number-fix coding-style tweaks Cc: Alex Elder Signed-off-by: Andrew Morton --- lib/parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.5