changeset 116:bb039d7407f0

Fix for floating point crash when trying to calculate new slider/percent positions.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 19 Oct 2002 00:13:23 +0000
parents 2d121d4d90c0
children d785ee5adf02
files os2/dw.c
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/os2/dw.c	Wed Oct 09 19:31:11 2002 +0000
+++ b/os2/dw.c	Sat Oct 19 00:13:23 2002 +0000
@@ -1580,11 +1580,14 @@
 void _dw_int_set(HWND hwnd, int pos)
 {
 	int inew, range = dw_percent_query_range(hwnd);
-	float fpos = (float)pos;
-	float frange = (float)range;
-	float fnew = (fpos/frange)*1000.0;
-	inew = (int)fnew;
-	dw_window_set_data(hwnd, "_dw_percent_value", (void *)inew);
+	if(range)
+	{
+		float fpos = (float)pos;
+		float frange = (float)range;
+		float fnew = (fpos/frange)*1000.0;
+		inew = (int)fnew;
+		dw_window_set_data(hwnd, "_dw_percent_value", (void *)inew);
+	}
 }
 
 /* Handle size changes in the percent class */