From 21d9e2c934b263c16ddba19013994f567f4e81b0 Mon Sep 17 00:00:00 2001 From: Darkvater Date: Tue, 17 May 2005 19:36:36 +0000 Subject: (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. --- signs.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'signs.h') diff --git a/signs.h b/signs.h index 2cc417ca0..4451f8f89 100644 --- a/signs.h +++ b/signs.h @@ -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) -- cgit v1.2.3-54-g00ecf