dynamically allocate storage for gethostby* buffers
[musl] / src / internal / intscan.c
index d65fc45..69350ef 100644 (file)
@@ -1,5 +1,6 @@
 #include <limits.h>
 #include <errno.h>
+#include <ctype.h>
 #include "shgetc.h"
 
 /* Lookup table for digit values. -1==255>=36 -> invalid */
@@ -32,7 +33,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);