Prevent OB1 error.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 20 Jul 2017 15:27:02 +0000 (11:27 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 20 Jul 2017 15:27:02 +0000 (11:27 -0400)
misc.c

diff --git a/misc.c b/misc.c
index 752838b02190ac7cc00033462a9d515b17d8c1c5..4b9ac2c1e8253eb28a9fc2ee6965d50fd90dfa0f 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -113,7 +113,7 @@ static void vspeak(const char* msg, bool blank, va_list ap)
             // Unmodified string specifier.
             if (msg[i] == 's') {
                char *arg = va_arg(ap, char *);
-                strncat(renderp, arg, size);
+                strncat(renderp, arg, size-1);
                 size_t len = strlen(renderp);
                 renderp += len;
                 size -= len;