diff options
Diffstat (limited to 'stdlib/strtol.c')
-rw-r--r-- | stdlib/strtol.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/stdlib/strtol.c b/stdlib/strtol.c index 1c63afb..a6c1957 100644 --- a/stdlib/strtol.c +++ b/stdlib/strtol.c @@ -175,6 +175,8 @@ INTERNAL (strtol) (nptr, endptr, base, group) else end = correctly_grouped_prefix (s, end, thousands, grouping); } + else + end = NULL; cutoff = ULONG_MAX / (unsigned LONG int) base; cutlim = ULONG_MAX % (unsigned LONG int) base; @@ -183,7 +185,7 @@ INTERNAL (strtol) (nptr, endptr, base, group) i = 0; for (c = *s; c != '\0'; c = *++s) { - if (group && s == end) + if (s == end) break; if (isdigit (c)) c -= '0'; |