From 47801ed88338a165ea5f512f8be061eadd125203 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Fri, 1 Dec 2006 12:57:31 +0000 Subject: [PATCH] (svn r7319) -Fix (r7182): (NewGRF) Add space for terminator when translating TTDPatch strings (thanks eddi) --- newgrf_text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newgrf_text.c b/newgrf_text.c index 6596c82d2f..3afffb9593 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);