word_wrap - Dont' call strlen once every loop iteration

This commit is contained in:
twinaphex 2017-03-05 19:09:31 +01:00
parent c70b8c42c5
commit bb15b14388

View File

@ -167,9 +167,10 @@ char *string_trim_whitespace(char *const s)
char* word_wrap(char* buffer, char* string, int line_width)
{
unsigned i = 0;
unsigned i = 0;
unsigned len = strlen(string);
while(i < strlen(string))
while (i < len)
{
unsigned counter;