# HG changeset patch # User peter1138 # Date 1164977851 0 # Node ID 353037c3a1965ba2bc71f9797695f7a2575bb634 # Parent 527eaecd804ef7a5f39298730a4a4d2ec05b5f94 (svn r7319) -Fix (r7182): (NewGRF) Add space for terminator when translating TTDPatch strings (thanks eddi) diff --git a/newgrf_text.c b/newgrf_text.c --- a/newgrf_text.c +++ b/newgrf_text.c @@ -156,7 +156,7 @@ 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);