Address GitLab issue #28: Advent hangs on some inputs
[open-adventure.git] / 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;