summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--newgrf_text.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/newgrf_text.c b/newgrf_text.c
index 6596c82d2..3afffb959 100644
--- a/newgrf_text.c
+++ b/newgrf_text.c
@@ -156,7 +156,7 @@ static byte _currentLangID = GRFLX_ENGLISH; //by default, english is used.
static char *TranslateTTDPatchCodes(const char *str)
{
- char *tmp = malloc(strlen(str) * 10); /* Allocate space to allow for expansion */
+ char *tmp = malloc(strlen(str) * 10 + 1); /* Allocate space to allow for expansion */
char *d = tmp;
bool unicode = false;
WChar c = Utf8Consume(&str);