From: Rich Felker Date: Fri, 2 Mar 2012 17:48:17 +0000 (-0500) Subject: fix obscure bug in strtoull reading the highest 16 possible values X-Git-Tag: v0.8.7~27 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b4a07bb469ad5a81ee003b621c362d2e7be38159;p=oweals%2Fmusl.git fix obscure bug in strtoull reading the highest 16 possible values --- diff --git a/src/internal/intparse.c b/src/internal/intparse.c index 90aa8339..ffd06fe0 100644 --- a/src/internal/intparse.c +++ b/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;