fix really bad breakage in strtol, etc.: failure to accept leading spaces
[musl] / src / internal / intscan.c
index d65fc45..178cdf0 100644 (file)
@@ -32,7 +32,7 @@ unsigned long long __intscan(FILE *f, unsigned base, int pok, unsigned long long
                errno = EINVAL;
                return 0;
        }
-       c = shgetc(f);
+       while (isspace((c=shgetc(f))));
        if (c=='+' || c=='-') {
                neg = -(c=='-');
                c = shgetc(f);