mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-03 04:14:20 +01:00
fixed bug with infinite loop in some circumstances in fitText() in WINGs
This commit is contained in:
@@ -107,7 +107,7 @@ fitText(char *text, WMFont *font, int width, int wrap)
|
||||
int i, w, beforecrlf, word1, word2;
|
||||
|
||||
/* text length before first cr/lf */
|
||||
beforecrlf = strcspn(text, "\n\r");
|
||||
beforecrlf = strcspn(text, "\n");
|
||||
|
||||
if (!wrap || beforecrlf==0)
|
||||
return beforecrlf;
|
||||
@@ -180,7 +180,7 @@ fitText(char *text, WMFont *font, int width, int wrap)
|
||||
i = j;
|
||||
}
|
||||
} else {
|
||||
i = strcspn(text, "\n\r");
|
||||
i = strcspn(text, "\n");
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user