batman-adv: Fix signedness problem in parse_gw_bandwidth
authorSven Eckelmann <sven@narfation.org>
Sat, 4 Jun 2011 12:00:49 +0000 (14:00 +0200)
committerSven Eckelmann <sven@narfation.org>
Thu, 9 Jun 2011 18:40:38 +0000 (20:40 +0200)
strict_strtoul as used in parse_gw_bandwidth is defined for unsigned
long and strict_strtol should be used instead for long.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/gateway_common.c

index ed3bd366a2a90b17b2634251e633cbe80aa07e20..e74307be8e0c31c2c066aac7afedd93d87170d8a 100644 (file)
@@ -97,7 +97,7 @@ static bool parse_gw_bandwidth(struct net_device *net_dev, char *buff,
                        *tmp_ptr = '\0';
        }
 
-       ret = strict_strtoul(buff, 10, &ldown);
+       ret = strict_strtol(buff, 10, &ldown);
        if (ret) {
                bat_err(net_dev,
                        "Download speed of gateway mode invalid: %s\n",
@@ -122,7 +122,7 @@ static bool parse_gw_bandwidth(struct net_device *net_dev, char *buff,
                                *tmp_ptr = '\0';
                }
 
-               ret = strict_strtoul(slash_ptr + 1, 10, &lup);
+               ret = strict_strtol(slash_ptr + 1, 10, &lup);
                if (ret) {
                        bat_err(net_dev,
                                "Upload speed of gateway mode invalid: "