mirror of git://git.musl-libc.org/musl
fix obscure bug in strtoull reading the highest 16 possible values
This commit is contained in:
parent
9fcecd7b34
commit
b4a07bb469
|
@ -87,7 +87,7 @@ int __intparse(struct intparse *v, const void *buf, size_t n)
|
||||||
v->val = v->val * b + d;
|
v->val = v->val * b + d;
|
||||||
if (!n) return 1;
|
if (!n) return 1;
|
||||||
if (d >= b) goto finished;
|
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;
|
v->val = v->val * b + d;
|
||||||
else
|
else
|
||||||
v->err = ERANGE;
|
v->err = ERANGE;
|
||||||
|
|
Loading…
Reference in New Issue