diff options
author | rubidium <rubidium@openttd.org> | 2010-11-10 17:49:44 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-11-10 17:49:44 +0000 |
commit | 1ddc05e822387a4dfc8c902e0e88ab59f97923b7 (patch) | |
tree | 6089c109bff78fd65a95113b36f3f1da2155099c /src/strings.cpp | |
parent | 17b514ccd191f8aa57a1464c4223c3a3f5034ad9 (diff) | |
download | openttd-1ddc05e822387a4dfc8c902e0e88ab59f97923b7.tar.xz |
(svn r21134) -Change: perform some more stringent validity checking on the language files
Diffstat (limited to 'src/strings.cpp')
-rw-r--r-- | src/strings.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/strings.cpp b/src/strings.cpp index b2318ccc4..3318acdd4 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -1307,7 +1307,16 @@ bool LanguagePackHeader::IsValid() const { return this->ident == TO_LE32(LanguagePackHeader::IDENT) && - this->version == TO_LE32(LANGUAGE_PACK_VERSION); + this->version == TO_LE32(LANGUAGE_PACK_VERSION) && + this->plural_form < LANGUAGE_MAX_PLURAL && + this->text_dir <= 1 && + this->newgrflangid < MAX_LANG && + StrValid(this->name, lastof(this->name)) && + StrValid(this->own_name, lastof(this->own_name)) && + StrValid(this->isocode, lastof(this->isocode)) && + StrValid(this->digit_group_separator, lastof(this->digit_group_separator)) && + StrValid(this->digit_group_separator_currency, lastof(this->digit_group_separator_currency)) && + StrValid(this->digit_decimal_separator, lastof(this->digit_decimal_separator)); } bool ReadLanguagePack(int lang_index) |