From b9b663ea795de29fc2a12ba6f645c70dcb6f7deb Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Fri, 7 Sep 2012 10:24:52 +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