changeset 10465 | 0c68afe3d725 |
parent 9207 | 2b390a312384 |
child 10751 | ebd94f2d6385 |
--- a/src/string_func.h Thu May 08 13:06:12 2008 +0000 +++ b/src/string_func.h Thu May 08 13:20:54 2008 +0000 @@ -45,10 +45,10 @@ /** 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; }