diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c index f03f7251b..fdce13533 100644 --- a/src/stdlib/SDL_string.c +++ b/src/stdlib/SDL_string.c @@ -549,7 +549,7 @@ SDL_utf8strlen(const char *str) const char *p = str; char ch; - while ((ch = *(p++))) { + while ((ch = *(p++)) != 0) { /* if top two bits are 1 and 0, it's a continuation byte. */ if ((ch & 0xc0) != 0x80) { retval++;