浏览代码

fix typo in exponent reading code or floats

this was basically harmless, but could have resulted in misreading
inputs with more than a few gigabytes worth of digits..
Rich Felker 13 年之前
父节点
当前提交
1ff3e6fa25
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/internal/floatscan.c

+ 1 - 1
src/internal/floatscan.c

@@ -44,7 +44,7 @@ static long long scanexp(FILE *f, int pok)
 	}
 	for (x=0; c-'0'<10U && x<INT_MAX/10; c = shgetc(f))
 		x = 10*x + c-'0';
-	for (y=x; c-'0'<10U && x<LLONG_MAX/100; c = shgetc(f))
+	for (y=x; c-'0'<10U && y<LLONG_MAX/100; c = shgetc(f))
 		y = 10*y + c-'0';
 	for (; c-'0'<10U; c = shgetc(f));
 	shunget(f);