# HG changeset patch # User peter1138 # Date 2006-12-01 12:57:31 # Node ID 67bbb022333d57a2222fda911480e4944c54fb5b # Parent eaa20dca8961f31ab046e7d8366bc2a9765b9c65 (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 byte _currentLangID = GRFLX_ENGLI 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);