summaryrefslogtreecommitdiff
path: root/parse
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-06-16 23:06:39 -0400
committerOri Bernstein <ori@eigenstate.org>2014-06-16 23:06:39 -0400
commit98c29a7d20344c57c0b8e5ef0f846961fc46ad6a (patch)
tree7f6cd8e2a074f3014e955787531f257848cf9d4e /parse
parent994d0ecb8ed4f5f78801669a607dad572c0d93a1 (diff)
downloadmc-98c29a7d20344c57c0b8e5ef0f846961fc46ad6a.tar.gz
Truncate the message in the right place.
Diffstat (limited to 'parse')
-rw-r--r--parse/tok.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse/tok.c b/parse/tok.c
index 0464a9a..f7d4114 100644
--- a/parse/tok.c
+++ b/parse/tok.c
@@ -642,7 +642,7 @@ static Tok *number(int base)
else if (hexval(c) < 0 || hexval(c) > base)
fatal(line, "Integer digit '%c' outside of base %d", c, base);
if (nbuf >= sizeof buf) {
- buf[nbuf] = '\0';
+ buf[nbuf-1] = '\0';
fatal(line, "number %s... too long to represent", buf);
}
buf[nbuf++] = c;