(svn r7475) -Fix (r7348): sanity check NewGRF action 8 strings for null terminator

This commit is contained in:
peter1138
2006-12-10 21:39:38 +00:00
parent aca5d1926a
commit eaeceec672
2 changed files with 29 additions and 4 deletions

View File

@@ -46,6 +46,16 @@ typedef enum CharSetFilter {
/** Convert the given string to lowercase, only works with ASCII! */
void strtolower(char *str);
/** Get the length of a string, within a limited buffer */
static inline int ttd_strnlen(const char *str, int maxlen)
{
const char *t;
for (t = str; *t != '\0' && t - str < maxlen; t++);
return t - str;
}
typedef uint32 WChar;
/**