# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1034986403 0 # Node ID bb039d7407f0fd402fca83766c267b744b2bc55f # Parent 2d121d4d90c04d678c7c0755fcfced6bcc741831 Fix for floating point crash when trying to calculate new slider/percent positions. diff -r 2d121d4d90c0 -r bb039d7407f0 os2/dw.c --- 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 */