diff options
author | rubidium <rubidium@openttd.org> | 2010-01-04 21:58:47 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-01-04 21:58:47 +0000 |
commit | 92c75f90929a5c6ffa5fab05dc34bb40aad04160 (patch) | |
tree | 73517ee207e33095c2957cd43ffa59777eb6b87d /src/strgen | |
parent | 28fc7b47bd35acc860e84e3885d13ffb0fad2c83 (diff) | |
download | openttd-92c75f90929a5c6ffa5fab05dc34bb40aad04160.tar.xz |
(svn r18727) -Fix [FS#3480]: some invalid gender/plural indices in strings, which could eventually cause crashes.
Diffstat (limited to 'src/strgen')
-rw-r--r-- | src/strgen/strgen.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp index 61fcecd7b..a44644949 100644 --- a/src/strgen/strgen.cpp +++ b/src/strgen/strgen.cpp @@ -965,7 +965,11 @@ static int TranslateArgumentIdx(int argidx, int offset) } const CmdStruct *cs = _cur_pcs.cmd[argidx]; if (cs != NULL && cs->consumes <= offset) { - error("invalid argidx offset %d:%d\n", argidx, offset); + error("invalid argidx offset %d:%d", argidx, offset); + } + + if (_cur_pcs.cmd[argidx] == NULL) { + error("no command for this argidx %d", argidx); } for (int i = sum = 0; i < argidx; i++) { |