X-Git-Url: http://git.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=system-linux.c;h=ddc31d82ed182019af6b8b73959957a0874307ab;hp=3e11bdfccbad1490755df2ddd9b69be136d9d432;hb=a063705a03a6c5a41b5f7aed251bfb3ba5c844c3;hpb=e6ebe0bfcdb7df25f1d96d367e8c0ad49b1642e3 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;