word_wrap: hack to workaround long lines without spaces
This commit is contained in:
parent
e235a0991c
commit
fe6dda917a
|
@ -159,6 +159,7 @@ char *word_wrap(char* buffer, const char *string, int line_width, bool unicode)
|
||||||
while (i < len)
|
while (i < len)
|
||||||
{
|
{
|
||||||
unsigned counter;
|
unsigned counter;
|
||||||
|
int pos = &buffer[i] - buffer;
|
||||||
|
|
||||||
/* copy string until the end of the line is reached */
|
/* copy string until the end of the line is reached */
|
||||||
for (counter = 1; counter <= (unsigned)line_width; counter++)
|
for (counter = 1; counter <= (unsigned)line_width; counter++)
|
||||||
|
@ -214,6 +215,9 @@ char *word_wrap(char* buffer, const char *string, int line_width, bool unicode)
|
||||||
i = k + 1;
|
i = k + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (&buffer[i] - buffer == pos)
|
||||||
|
return buffer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue