summaryrefslogtreecommitdiff
path: root/parse/tok.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-06-26 17:51:32 -0700
committerOri Bernstein <ori@eigenstate.org>2015-06-26 17:51:32 -0700
commitfa8e0920764f9f298d6b6ac9471c862aec024e01 (patch)
tree1de50b002db5b01ae6a6379d51d0599da4de4e73 /parse/tok.c
parentc1d212afb2854639aae86b9a44650f0769d0b90c (diff)
downloadmc-fa8e0920764f9f298d6b6ac9471c862aec024e01.tar.gz
Fix a few misc memory bugs.
Diffstat (limited to 'parse/tok.c')
-rw-r--r--parse/tok.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse/tok.c b/parse/tok.c
index 01df563..685acc1 100644
--- a/parse/tok.c
+++ b/parse/tok.c
@@ -650,7 +650,7 @@ static Tok *number(int base)
isfloat = 1;
else if (hexval(c) < 0 || hexval(c) > base)
lfatal(curloc, "Integer digit '%c' outside of base %d", c, base);
- if (nbuf >= sizeof buf) {
+ if (nbuf >= sizeof buf - 1) {
buf[nbuf-1] = '\0';
lfatal(curloc, "number %s... too long to represent", buf);
}