diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-09-23 17:17:53 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-09-23 17:17:53 +0200 |
commit | 1f27ab0d4bb65425496ff4ed0fbbd0f5bb32786f (patch) | |
tree | a7181ba3c498570257040c8663f125938ecad0a6 /miscutils/crond.c | |
parent | 8d338173a4668740b1ab4a40d1d26cd25402e406 (diff) | |
download | busybox-w32-1f27ab0d4bb65425496ff4ed0fbbd0f5bb32786f.tar.gz busybox-w32-1f27ab0d4bb65425496ff4ed0fbbd0f5bb32786f.tar.bz2 busybox-w32-1f27ab0d4bb65425496ff4ed0fbbd0f5bb32786f.zip |
*: 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>
Diffstat (limited to 'miscutils/crond.c')
-rw-r--r-- | miscutils/crond.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/miscutils/crond.c b/miscutils/crond.c index f0b64fe3a..d2104c36f 100644 --- a/miscutils/crond.c +++ b/miscutils/crond.c | |||
@@ -320,11 +320,13 @@ static void ParseField(char *user, char *ary, int modvalue, int off, | |||
320 | skip = 1; | 320 | skip = 1; |
321 | ++ptr; | 321 | ++ptr; |
322 | } else if (isdigit(*ptr)) { | 322 | } else if (isdigit(*ptr)) { |
323 | char *endp; | ||
323 | if (n1 < 0) { | 324 | if (n1 < 0) { |
324 | n1 = strtol(ptr, &ptr, 10) + off; | 325 | n1 = strtol(ptr, &endp, 10) + off; |
325 | } else { | 326 | } else { |
326 | n2 = strtol(ptr, &ptr, 10) + off; | 327 | n2 = strtol(ptr, &endp, 10) + off; |
327 | } | 328 | } |
329 | ptr = endp; /* gcc likes temp var for &endp */ | ||
328 | skip = 1; | 330 | skip = 1; |
329 | } else if (names) { | 331 | } else if (names) { |
330 | int i; | 332 | int i; |
@@ -361,7 +363,9 @@ static void ParseField(char *user, char *ary, int modvalue, int off, | |||
361 | n2 = n1; | 363 | n2 = n1; |
362 | } | 364 | } |
363 | if (*ptr == '/') { | 365 | if (*ptr == '/') { |
364 | skip = strtol(ptr + 1, &ptr, 10); | 366 | char *endp; |
367 | skip = strtol(ptr + 1, &endp, 10); | ||
368 | ptr = endp; /* gcc likes temp var for &endp */ | ||
365 | } | 369 | } |
366 | 370 | ||
367 | /* | 371 | /* |