summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-03-02 12:48:17 -0500
committerRich Felker <dalias@aerifal.cx>2012-03-02 12:48:17 -0500
commitb4a07bb469ad5a81ee003b621c362d2e7be38159 (patch)
tree8912cb826f25205a943b660c8f939aee40a1f403
parent9fcecd7b34c66e9d0a2b000809e022a4f3e5e951 (diff)
downloadmusl-b4a07bb469ad5a81ee003b621c362d2e7be38159.tar.gz
musl-b4a07bb469ad5a81ee003b621c362d2e7be38159.tar.bz2
musl-b4a07bb469ad5a81ee003b621c362d2e7be38159.tar.xz
musl-b4a07bb469ad5a81ee003b621c362d2e7be38159.zip
fix obscure bug in strtoull reading the highest 16 possible values
-rw-r--r--src/internal/intparse.c2
1 files changed, 1 insertions, 1 deletions
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;