Commit 507d4bcd68599a23097132f82dfdd9e4ede8a154

Ozkan Sezer 2021-12-18T14:01:02

SDL_utf8strlen: run bit-test explicitly on unsigned char

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c
index 13d6c54..7a894de 100644
--- a/src/stdlib/SDL_string.c
+++ b/src/stdlib/SDL_string.c
@@ -670,7 +670,7 @@ SDL_utf8strlen(const char *str)
 {
     size_t retval = 0;
     const char *p = str;
-    char ch;
+    unsigned char ch;
 
     while ((ch = *(p++)) != 0) {
         /* if top two bits are 1 and 0, it's a continuation byte. */