Subject: Transient pager core dump

From: Brad Giaccio <[email-masked]>
Date: Wed, 7 Apr 1999 10:47:35 -0400

I'm not sure how long this was a problem since I haven't tried it in
a whilebut the following fix is needed to fix a core dump at startup,
the problem as far as I could tell was a division by zero problem on
window_w, now why window_w was == 0 I don't know.

Index: x_pager.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmPager/x_pager.c,v
retrieving revision 1.29
diff -u -B -b -r1.29 x_pager.c
--- x_pager.c   1999/04/03 20:01:09     1.29
+++ x_pager.c   1999/04/07 14:44:25
@@ -1531,10 +1532,17 @@
       if(y > window_h)
        y = window_h;
 
+      sx = 0;
+      sy = 0;
+      if(window_w != 0) 
       sx = (100*(x*(Scr.VxMax+Scr.MyDisplayWidth)/window_w- Scr.Vx)) /
        Scr.MyDisplayWidth;
+      if(window_h != 0) 
       sy = (100*(y*(Scr.VyMax+Scr.MyDisplayHeight)/window_h - Scr.Vy)) /
        Scr.MyDisplayHeight;
+#ifdef DEBUG
+  fprintf(stderr,"[scroll]: %d %d %d %d %d %d\n", window_w, window_h, x, y, sx,sy);
+#endif
       /* Make sure we don't get stuck a few pixels fromt the top/left border.
        * Since sx/sy are ints, values between 0 and 1 are rounded down. */
       if(sx == 0 && x == 0 && Scr.Vx != 0) sx = -1;

-- 
--- There are two kinds of knowledge, you either know the answer or
			you know where to find it
		      -Kane, Johnson, and anonymous
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]