Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/user32/listbox.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 3f1396d16d..05fcc4439f 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -2354,8 +2354,7 @@ static LRESULT LISTBOX_HandleKeyDown( LB_DESCR *descr, DWORD key ) if (descr->style & LBS_MULTICOLUMN) { bForceSelection = FALSE; - if (descr->focus_item + descr->page_size < descr->nb_items) - caret = descr->focus_item + descr->page_size; + caret = min(descr->focus_item + descr->page_size, descr->nb_items - 1); break; } /* fall through */