diff options
author | Darkvater <darkvater@openttd.org> | 2005-05-17 19:36:36 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2005-05-17 19:36:36 +0000 |
commit | 21d9e2c934b263c16ddba19013994f567f4e81b0 (patch) | |
tree | c543be0e66d8dd3694e7f9692a54795b6791ce93 /signs.h | |
parent | 90ca24f7b64f9a23dfe771d4e13f55a10b5d2db9 (diff) | |
download | openttd-21d9e2c934b263c16ddba19013994f567f4e81b0.tar.xz |
(svn r2342) - Fix (Regression): _cmd_text is always valid, so test the first character for '\0'. Also for some reason I forgot to validate the p1 param so that might lead to crashes with invalid signes. Fixed as well.
Diffstat (limited to 'signs.h')
-rw-r--r-- | signs.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -41,6 +41,11 @@ static inline uint16 GetSignPoolSize(void) return _sign_pool.total_items; } +static inline bool IsSignIndex(uint index) +{ + return index < GetSignPoolSize(); +} + #define FOR_ALL_SIGNS_FROM(ss, start) for (ss = GetSign(start); ss != NULL; ss = (ss->index + 1 < GetSignPoolSize()) ? GetSign(ss->index + 1) : NULL) #define FOR_ALL_SIGNS(ss) FOR_ALL_SIGNS_FROM(ss, 0) |