*: optimize code size in strtoul calls
function old new delta
bb_parse_mode 433 431 -2
rtnl_rtntype_a2n 202 198 -4
ParseField 511 498 -13
bb_init_module_24 4730 4675 -55
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-74) Total: -74 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/networking/tc.c b/networking/tc.c
index fc47e95..d963694 100644
--- a/networking/tc.c
+++ b/networking/tc.c
@@ -89,7 +89,7 @@
if (p == str)
return 1;
maj <<= 16;
- if (*p != ':' && *p!=0)
+ if (*p != ':' && *p != '\0')
return 1;
ok:
*h = maj;
@@ -119,7 +119,8 @@
maj <<= 16;
str = p + 1;
min = strtoul(str, &p, 16);
- if (*p != 0 || min >= (1<<16))
+//FIXME: check for "" too?
+ if (*p != '\0' || min >= (1<<16))
return 1;
maj |= min;
} else if (*p != 0)