From 2d0e72d756213f4bdf942a668029a2652e8827cc Mon Sep 17 00:00:00 2001
From: Jaime Passos <lazymyuutsu@gmail.com>
Date: Sat, 8 Feb 2020 21:40:30 -0300
Subject: [PATCH] Fix broken GT_ constants with custom gametypes

---
 src/g_game.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/g_game.c b/src/g_game.c
index 8383782cb4..efc96a50fc 100644
--- a/src/g_game.c
+++ b/src/g_game.c
@@ -3256,8 +3256,8 @@ void G_AddGametypeConstant(INT16 gtype, const char *newgtconst)
 {
 	size_t r = 0; // read
 	size_t w = 0; // write
-	char *gtconst = Z_Calloc(strlen(newgtconst) + 3, PU_STATIC, NULL);
-	char *tmpconst = Z_Calloc(strlen(newgtconst), PU_STATIC, NULL);
+	char *gtconst = Z_Calloc(strlen(newgtconst) + 4, PU_STATIC, NULL);
+	char *tmpconst = Z_Calloc(strlen(newgtconst) + 1, PU_STATIC, NULL);
 
 	// Copy the gametype name.
 	strcpy(tmpconst, newgtconst);
-- 
GitLab