mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 02:32:06 +00:00
utf8decoder: Use byte-sized byte argument
This prevents passing a negative value out of a signed char by accident. Also renders some casts in the code superfluous.
This commit is contained in:
@@ -69,7 +69,7 @@ size_t readUTF8Char(uint8_t *dest, char const *src)
|
||||
size_t i = 0;
|
||||
|
||||
for (;;) {
|
||||
if (decode(&state, &codep, (uint8_t)src[i]) == 1)
|
||||
if (decode(&state, &codep, src[i]) == 1)
|
||||
fatalerror("invalid UTF-8 character\n");
|
||||
|
||||
dest[i] = src[i];
|
||||
|
||||
Reference in New Issue
Block a user