(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.

This commit is contained in:
Darkvater
2005-05-17 19:36:36 +00:00
parent 90ca24f7b6
commit 21d9e2c934
2 changed files with 9 additions and 2 deletions

View File

@@ -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)