mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
fix endless word_wrap() loop when a label has a newline and no spaces
This commit is contained in:
parent
d57d672d15
commit
ee49eeec09
@ -1911,7 +1911,7 @@ char* word_wrap (char* buffer, char* string, int line_width) {
|
||||
i++;
|
||||
}
|
||||
/* check for whitespace */
|
||||
if ( isspace( string[ i ] ) )
|
||||
if (string[i] == ' ')
|
||||
{
|
||||
buffer[i] = '\n';
|
||||
i++;
|
||||
@ -1921,7 +1921,7 @@ char* word_wrap (char* buffer, char* string, int line_width) {
|
||||
/* check for nearest whitespace back in string */
|
||||
for ( k = i; k > 0; k--)
|
||||
{
|
||||
if ( isspace( string[ k ] ) )
|
||||
if (string[k] == ' ')
|
||||
{
|
||||
buffer[ k ] = '\n';
|
||||
/* set string index back to character after this one */
|
||||
|
Loading…
x
Reference in New Issue
Block a user