]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
utils: Fix get_s64() function
authorKurt Kanzenbach <kurt@linutronix.de>
Thu, 4 Jul 2019 12:24:27 +0000 (14:24 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 29 Jul 2019 15:44:20 +0000 (08:44 -0700)
get_s64() uses internally strtoll() to parse the value out of a given
string. strtoll() returns a long long. However, the intermediate variable is
long only which might be 32 bit on some systems. So, fix it.

Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
lib/utils.c

index 9ea21fa165033e1b37b3c1b44ce6363c014a4f05..4c43f8fd7fd0fbff2d194186354e810732e137de 100644 (file)
@@ -374,7 +374,7 @@ int get_u8(__u8 *val, const char *arg, int base)
 
 int get_s64(__s64 *val, const char *arg, int base)
 {
-       long res;
+       long long res;
        char *ptr;
 
        errno = 0;