*: optimize code size in strtoul calls
[oweals/busybox.git] / miscutils / crond.c
index f0b64fe3aaeb9a298c987c6d7385730443626e79..d2104c36f883c9dd2c8f521f5b6c6995c20ee99a 100644 (file)
@@ -320,11 +320,13 @@ static void ParseField(char *user, char *ary, int modvalue, int off,
                        skip = 1;
                        ++ptr;
                } else if (isdigit(*ptr)) {
+                       char *endp;
                        if (n1 < 0) {
-                               n1 = strtol(ptr, &ptr, 10) + off;
+                               n1 = strtol(ptr, &endp, 10) + off;
                        } else {
-                               n2 = strtol(ptr, &ptr, 10) + off;
+                               n2 = strtol(ptr, &endp, 10) + off;
                        }
+                       ptr = endp; /* gcc likes temp var for &endp */
                        skip = 1;
                } else if (names) {
                        int i;
@@ -361,7 +363,9 @@ static void ParseField(char *user, char *ary, int modvalue, int off,
                        n2 = n1;
                }
                if (*ptr == '/') {
-                       skip = strtol(ptr + 1, &ptr, 10);
+                       char *endp;
+                       skip = strtol(ptr + 1, &endp, 10);
+                       ptr = endp; /* gcc likes temp var for &endp */
                }
 
                /*