user32: Fix segfault when combobox contains a longer text than buffer_limit.

This commit is contained in:
Alex Busenius 2007-10-21 13:28:17 +02:00 committed by Alexandre Julliard
parent 604867c9dd
commit ca625836de
1 changed files with 5 additions and 1 deletions

View File

@ -3203,7 +3203,11 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, LPCWSTR lpsz_replac
* such that buffer limit is honored. */
if ((honor_limit) && (size > es->buffer_limit)) {
EDIT_NOTIFY_PARENT(es, EN_MAXTEXT);
strl = es->buffer_limit - (tl - (e-s));
/* Buffer limit can be smaller than the actual length of text in combobox */
if (es->buffer_limit < (tl - (e-s)))
strl = 0;
else
strl = es->buffer_limit - (tl - (e-s));
}
if (!EDIT_MakeFit(es, tl - (e - s) + strl))