shithub: mc

Download patch

ref: 98c29a7d20344c57c0b8e5ef0f846961fc46ad6a
parent: 994d0ecb8ed4f5f78801669a607dad572c0d93a1
author: Ori Bernstein <[email protected]>
date: Mon Jun 16 19:06:39 EDT 2014

Truncate the message in the right place.

--- a/parse/tok.c
+++ b/parse/tok.c
@@ -642,7 +642,7 @@
         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;