]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
lib-parserc-avoid-overflow-in-match_number-fix
authorAndrew Morton <akpm@linux-foundation.org>
Wed, 26 Sep 2012 01:34:27 +0000 (11:34 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 27 Sep 2012 07:27:56 +0000 (17:27 +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;