Explorar o código

fix obscure bug in strtoull reading the highest 16 possible values

Rich Felker %!s(int64=13) %!d(string=hai) anos
pai
achega
b4a07bb469
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/internal/intparse.c

+ 1 - 1
src/internal/intparse.c

@@ -87,7 +87,7 @@ int __intparse(struct intparse *v, const void *buf, size_t n)
 			v->val = v->val * b + d;
 		if (!n) return 1;
 		if (d >= b) goto finished;
-		if (v->val < (UINTMAX_MAX-d)/b)
+		if (v->val <= (UINTMAX_MAX-d)/b)
 			v->val = v->val * b + d;
 		else
 			v->err = ERANGE;