naccyde / rpms / iproute

Forked from rpms/iproute 9 months ago
Clone

Blame SOURCES/iproute2-3.10.0-rtt.patch

7787e2
diff --git a/lib/utils.c b/lib/utils.c
7787e2
index dae1b51..55fea18 100644
7787e2
--- a/lib/utils.c
7787e2
+++ b/lib/utils.c
7787e2
@@ -144,8 +144,7 @@ int get_time_rtt(unsigned *val, const char *arg, int *raw)
7787e2
 		if (t < 0.0)
7787e2
 			return -1;
7787e2
 
7787e2
-		/* extra non-digits */
7787e2
-		if (!p || p == arg || *p)
7787e2
+		if (!p || p == arg)
7787e2
 			return -1;
7787e2
 
7787e2
 		/* over/underflow */
7787e2
@@ -154,8 +153,7 @@ int get_time_rtt(unsigned *val, const char *arg, int *raw)
7787e2
 	} else {
7787e2
 		res = strtoul(arg, &p, 0);
7787e2
 
7787e2
-		/* empty string or trailing non-digits */
7787e2
-		if (!p || p == arg || *p)
7787e2
+		if (!p || p == arg)
7787e2
 			return -1;
7787e2
 
7787e2
 		/* overflow */
7787e2
@@ -165,8 +163,6 @@ int get_time_rtt(unsigned *val, const char *arg, int *raw)
7787e2
 		t = (double)res;
7787e2
 	}
7787e2
 
7787e2
-	if (p == arg)
7787e2
-		return -1;
7787e2
 	*raw = 1;
7787e2
 
7787e2
 	if (*p) {