mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +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++;
|
i++;
|
||||||
}
|
}
|
||||||
/* check for whitespace */
|
/* check for whitespace */
|
||||||
if ( isspace( string[ i ] ) )
|
if (string[i] == ' ')
|
||||||
{
|
{
|
||||||
buffer[i] = '\n';
|
buffer[i] = '\n';
|
||||||
i++;
|
i++;
|
||||||
@ -1921,7 +1921,7 @@ char* word_wrap (char* buffer, char* string, int line_width) {
|
|||||||
/* check for nearest whitespace back in string */
|
/* check for nearest whitespace back in string */
|
||||||
for ( k = i; k > 0; k--)
|
for ( k = i; k > 0; k--)
|
||||||
{
|
{
|
||||||
if ( isspace( string[ k ] ) )
|
if (string[k] == ' ')
|
||||||
{
|
{
|
||||||
buffer[ k ] = '\n';
|
buffer[ k ] = '\n';
|
||||||
/* set string index back to character after this one */
|
/* set string index back to character after this one */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user