From 5ae1c396cc9eb24afa113068a6ecbfa114918a58 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Sat, 9 Sep 2000 19:39:24 +0000 Subject: [PATCH] Avoid divide by zero when listbox set to zero height. --- controls/listbox.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/controls/listbox.c b/controls/listbox.c index 03362a2b559..742f6642f08 100644 --- a/controls/listbox.c +++ b/controls/listbox.c @@ -348,7 +348,12 @@ static void LISTBOX_UpdateSize( WND *wnd, LB_DESCR *descr ) descr->height = rect.bottom - rect.top; if (!(descr->style & LBS_NOINTEGRALHEIGHT) && !(descr->style & LBS_OWNERDRAWVARIABLE)) { - UINT remaining = descr->height % descr->item_height; + UINT remaining; + + if(descr->item_height != 0) + remaining = descr->height % descr->item_height; + else + remaining = 0; if ((descr->height > descr->item_height) && remaining) { if (!(wnd->flags & WIN_ISWIN32)) -- 2.11.4.GIT