mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 07:20:36 +00:00
check for end of string before trying to read more
This commit is contained in:
parent
b0de197da4
commit
6b5d863136
@ -161,9 +161,6 @@ char *word_wrap(char* buffer, const char *string, int line_width, bool unicode)
|
||||
unsigned char_len;
|
||||
unsigned j = i;
|
||||
|
||||
character = utf8skip(&string[i], 1);
|
||||
char_len = character - &string[i];
|
||||
|
||||
/* check if end of string reached */
|
||||
if (i == len)
|
||||
{
|
||||
@ -171,6 +168,9 @@ char *word_wrap(char* buffer, const char *string, int line_width, bool unicode)
|
||||
return buffer;
|
||||
}
|
||||
|
||||
character = utf8skip(&string[i], 1);
|
||||
char_len = character - &string[i];
|
||||
|
||||
if (!unicode)
|
||||
counter += char_len - 1;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user