summaryrefslogtreecommitdiff
path: root/src/strgen/strgen.h
diff options
context:
space:
mode:
authorglx22 <glx22@users.noreply.github.com>2019-05-01 19:12:37 +0200
committerGitHub <noreply@github.com>2019-05-01 19:12:37 +0200
commitcef9a76c3ffaaf42bd9b85ff41afb0d9d45d05bc (patch)
tree45ed75981b198a52b447d6b58634d7a4d07a989e /src/strgen/strgen.h
parent28b23a66437f5897841c7d9ccf6157c30ac9313a (diff)
downloadopenttd-cef9a76c3ffaaf42bd9b85ff41afb0d9d45d05bc.tar.xz
Fix #7553: check bounds when loading strings (#7554)
Diffstat (limited to 'src/strgen/strgen.h')
-rw-r--r--src/strgen/strgen.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/strgen/strgen.h b/src/strgen/strgen.h
index fd527203b..69b8732f1 100644
--- a/src/strgen/strgen.h
+++ b/src/strgen/strgen.h
@@ -29,12 +29,12 @@ struct LangString {
char *name; ///< Name of the string.
char *english; ///< English text.
char *translated; ///< Translated text.
- uint16 hash_next; ///< Next hash entry.
- uint16 index; ///< The index in the language file.
+ size_t hash_next; ///< Next hash entry.
+ size_t index; ///< The index in the language file.
int line; ///< Line of string in source-file.
Case *translated_case; ///< Cases of the translation.
- LangString(const char *name, const char *english, int index, int line);
+ LangString(const char *name, const char *english, size_t index, int line);
~LangString();
void FreeTranslation();
};
@@ -42,10 +42,10 @@ struct LangString {
/** Information about the currently known strings. */
struct StringData {
LangString **strings; ///< Array of all known strings.
- uint16 *hash_heads; ///< Hash table for the strings.
+ size_t *hash_heads; ///< Hash table for the strings.
size_t tabs; ///< The number of 'tabs' of strings.
size_t max_strings; ///< The maximum number of strings.
- int next_string_id; ///< The next string ID to allocate.
+ size_t next_string_id;///< The next string ID to allocate.
StringData(size_t tabs);
~StringData();