home · contact · privacy
License everything (GPL).
[plomrogue] / src / client / draw_wins.c
index 6736a1bbb77b980872fa2950c6b57201f546bb22..7e8ca5aa307b9aa0fbc642f78c2bfbeb7bfe60a7 100644 (file)
@@ -1,4 +1,9 @@
-/* src/client/draw_wins.c */
+/* src/client/draw_wins.c
+ *
+ * This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3
+ * or any later version. For details on its copyright, license, and warranties,
+ * see the file NOTICE in the root directory of the PlomRogue source package.
+ */
 
 #define _POSIX_C_SOURCE 200809L /* strdup() */
 #include "draw_wins.h"
@@ -182,7 +187,7 @@ static void add_line_compact(struct Win * win, char * line, attr_t attri,
     uint16_t len_line = strlen(line);
     char * separator = last ? "" : " / ";
     uint32_t len_line_new = len_line + strlen(separator);
-    char * line_new = try_malloc(len_line_new, __func__);
+    char * line_new = try_malloc(len_line_new + 1, __func__);
     int test = sprintf(line_new, "%s%s", line, separator);
     exit_trouble(test < 0, __func__, "sprintf");
     uint16_t x = 0;