[LEDE-DEV] [netifd][PATCH] Remove redundant check for strtoul() return value
Khem Raj
raj.khem at gmail.com
Thu May 18 17:02:14 PDT 2017
Fixes
system-linux.c:1998:33: error: comparison of unsigned expression >= 0 is always true [-Werror,-Wtautological-compare]
Signed-off-by: Khem Raj <raj.khem at gmail.com>
---
system-linux.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/system-linux.c b/system-linux.c
index 3e11bdf..ddc31d8 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -1988,8 +1988,8 @@ bool system_resolve_rt_proto(const char *type, unsigned int *id)
FILE *f;
char *e, buf[128];
unsigned int n, proto = 256;
-
- if ((n = strtoul(type, &e, 0)) >= 0 && !*e && e != type)
+ n = strtoul(type, &e, 0);
+ if (!*e && e != type)
proto = n;
else if (!strcmp(type, "unspec"))
proto = RTPROT_UNSPEC;
--
2.13.0
More information about the Lede-dev
mailing list