summaryrefslogtreecommitdiff
path: root/src/strings.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2012-01-15 13:17:02 +0000
committeryexo <yexo@openttd.org>2012-01-15 13:17:02 +0000
commit15292fa08091e138d9a325ca75a2209225b699b1 (patch)
treeb177a7e33ad6db2c9eb92c4be9b175c4a864eae7 /src/strings.cpp
parent8e68a442b95ce0f1f4be82fe689049ad40b96086 (diff)
downloadopenttd-15292fa08091e138d9a325ca75a2209225b699b1.tar.xz
(svn r23804) -Fix: [NewGRF] Make string code 80 more secure by not crashing when it's used in strings where it's not supposed to be used
Diffstat (limited to 'src/strings.cpp')
-rw-r--r--src/strings.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/strings.cpp b/src/strings.cpp
index 663f3c953..15d478944 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -838,7 +838,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
}
case SCC_NEWGRF_PRINT_WORD_STRING_ID: {
- StringID substr = args->GetInt32(SCC_NEWGRF_PRINT_WORD_STRING_ID);
+ StringID substr = TTDPStringIDToOTTDStringIDMapping(args->GetInt32(SCC_NEWGRF_PRINT_WORD_STRING_ID));
str_stack.push(GetStringPtr(substr));
case_index = next_substr_case_index;
next_substr_case_index = 0;