Vladimir Pankratov : comctl32: Fix division by zero.

Alexandre Julliard julliard at winehq.org
Wed Jul 15 09:46:48 CDT 2009


Module: wine
Branch: master
Commit: 585e8dfbb4adac0ff1f5dd995ff92a2c4a0e288b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=585e8dfbb4adac0ff1f5dd995ff92a2c4a0e288b

Author: Vladimir Pankratov <scriptkid at mail.ru>
Date:   Tue Jul 14 14:01:23 2009 +0500

comctl32: Fix division by zero.

---

 dlls/comctl32/toolbar.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c
index c6cf83e..0d11b2b 100644
--- a/dlls/comctl32/toolbar.c
+++ b/dlls/comctl32/toolbar.c
@@ -4846,7 +4846,7 @@ TOOLBAR_SetRows (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPRECT lprc)
         if (seps) FIXME("Separators unhandled\n");
 
         /* Round up so more per line, i.e., less rows */
-        idealWrap = (infoPtr->nNumButtons - hidden + (rows-1)) / rows;
+        idealWrap = (infoPtr->nNumButtons - hidden + (rows-1)) / (rows ? rows : 1);
 
         /* Calculate ideal wrap point if we are allowed to grow, but cannot
            achieve the requested number of rows. */




More information about the wine-cvs mailing list