fix really bad breakage in strtol, etc.: failure to accept leading spaces

This commit is contained in:
Rich Felker
2012-04-19 12:47:34 -04:00
parent 769d3d3498
commit cb81b6947c
5 changed files with 9 additions and 10 deletions

View File

@ -394,12 +394,13 @@ static long double hexfloat(FILE *f, int bits, int emin, int sign, int pok)
return scalbnl(y, e2);
}
long double __floatscan(FILE *f, int c, int prec, int pok)
long double __floatscan(FILE *f, int prec, int pok)
{
int sign = 1;
int i;
int bits;
int emin;
int c;
switch (prec) {
case 0:
@ -418,7 +419,7 @@ long double __floatscan(FILE *f, int c, int prec, int pok)
return 0;
}
if (c<0) c = shgetc(f);
while (isspace((c=shgetc(f))));
if (c=='+' || c=='-') {
sign -= 2*(c=='-');