From 7572207564e889749249963c0afde9fefd7c68d8 Mon Sep 17 00:00:00 2001 From: Paul Quinn Date: Sat, 22 May 1999 18:45:06 +0000 Subject: [PATCH] Stop a listbox bug that causes a div by zero when the item height is zero. Doesn't solve the root of the problem though. --- controls/listbox.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controls/listbox.c b/controls/listbox.c index dbcf862d6c9..7cb45b97d2e 100644 --- a/controls/listbox.c +++ b/controls/listbox.c @@ -297,7 +297,8 @@ static void LISTBOX_UpdatePage( WND *wnd, LB_DESCR *descr ) { INT page_size; - if ((page_size = descr->height / descr->item_height) < 1) page_size = 1; + if ((descr->item_height == 0) || (page_size = descr->height / descr->item_height) < 1) + page_size = 1; if (page_size == descr->page_size) return; descr->page_size = page_size; if (descr->style & LBS_MULTICOLUMN)