Fixed bug in TEXT_WordBreak that was variously throwing Lotus Notes

into an infinite loop or causing it to crash.
oldstable
Robert O'Callahan 2002-04-27 00:14:16 +00:00 committed by Alexandre Julliard
parent 5769d1de00
commit 71a8a74b43
1 changed files with 3 additions and 1 deletions

View File

@ -356,13 +356,15 @@ static void TEXT_WordBreak (HDC hdc, WCHAR *str, unsigned int max_str,
/* If there was one or the first character didn't fit then */
if (word_fits)
{
int next_is_space;
/* break the line before/after that character */
if (!(format & (DT_RIGHT | DT_CENTER)) || *p != SPACE)
p++;
next_is_space = (p - str) < *len_str && *p == SPACE;
*len_str = p - str;
/* and if the next character is a space then discard it. */
*chars_used = *len_str;
if (*p == SPACE)
if (next_is_space)
(*chars_used)++;
}
/* Suppose there was none. */