]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
lib-parserc-avoid-overflow-in-match_number-fix
authorAndrew Morton <akpm@linux-foundation.org>
Thu, 13 Sep 2012 01:01:11 +0000 (11:01 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 13 Sep 2012 07:28:09 +0000 (17:28 +1000)
coding-style tweaks

Cc: Alex Elder <elder@inktank.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/parser.c

index 2499cb87774c3603788cf3ac3e5d0140721fb750..52cfa69f73dfe514b7424f0edf1c236a5e0edb59 100644 (file)
@@ -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;