Fix the rtt values parser
This commit is contained in:
parent
241ab40617
commit
56aa986702
31
iproute2-3.11.0-rtt.patch
Normal file
31
iproute2-3.11.0-rtt.patch
Normal file
@ -0,0 +1,31 @@
|
||||
diff --git a/lib/utils.c b/lib/utils.c
|
||||
index dae1b51..8a1a65d 100644
|
||||
--- a/lib/utils.c
|
||||
+++ b/lib/utils.c
|
||||
@@ -145,7 +145,7 @@ int get_time_rtt(unsigned *val, const char *arg, int *raw)
|
||||
return -1;
|
||||
|
||||
/* extra non-digits */
|
||||
- if (!p || p == arg || *p)
|
||||
+ if (!p || p == arg)
|
||||
return -1;
|
||||
|
||||
/* over/underflow */
|
||||
@@ -155,7 +155,7 @@ int get_time_rtt(unsigned *val, const char *arg, int *raw)
|
||||
res = strtoul(arg, &p, 0);
|
||||
|
||||
/* empty string or trailing non-digits */
|
||||
- if (!p || p == arg || *p)
|
||||
+ if (!p || p == arg)
|
||||
return -1;
|
||||
|
||||
/* overflow */
|
||||
@@ -165,8 +165,6 @@ int get_time_rtt(unsigned *val, const char *arg, int *raw)
|
||||
t = (double)res;
|
||||
}
|
||||
|
||||
- if (p == arg)
|
||||
- return -1;
|
||||
*raw = 1;
|
||||
|
||||
if (*p) {
|
Loading…
Reference in New Issue
Block a user