From e48a351f8e006b19d9e2c7bf9ef672a1e141d85f Mon Sep 17 00:00:00 2001 From: glx Date: Thu, 8 May 2008 13:20:54 +0000 Subject: (svn r13008) -Fix [FS#1997]: silence some MSVC x64 warnings --- src/string_func.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/string_func.h') diff --git a/src/string_func.h b/src/string_func.h index 0733931f3..0e7aa5331 100644 --- a/src/string_func.h +++ b/src/string_func.h @@ -45,10 +45,10 @@ static inline bool StrEmpty(const char *s) { return s == NULL || s[0] == '\0'; } /** Get the length of a string, within a limited buffer */ -static inline int ttd_strnlen(const char *str, int maxlen) +static inline size_t ttd_strnlen(const char *str, size_t maxlen) { const char *t; - for (t = str; *t != '\0' && t - str < maxlen; t++) {} + for (t = str; *t != '\0' && (size_t)(t - str) < maxlen; t++) {} return t - str; } -- cgit v1.2.3-54-g00ecf