changeset 32824:6521cc146e8e

(size_window): Prevent setting window's width or height to a negative value (esp. with XSETFASTINT).
author Gerd Moellmann <gerd@gnu.org>
date Tue, 24 Oct 2000 14:05:17 +0000
parents 2a7f61d7ae12
children 3e1d004030c5
files src/window.c
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/window.c	Tue Oct 24 14:00:55 2000 +0000
+++ b/src/window.c	Tue Oct 24 14:05:17 2000 +0000
@@ -2314,6 +2314,7 @@
   int old_size, min_size;
 
   check_min_window_sizes ();
+  size = max (0, size);
   
   /* If the window has been "too small" at one point,
      don't delete it for being "too small" in the future.
@@ -2350,22 +2351,22 @@
     }
 
   /* Set redisplay hints.  */
-  XSETFASTINT (w->last_modified, 0);
-  XSETFASTINT (w->last_overlay_modified, 0);
+  w->last_modified = make_number (0);
+  w->last_overlay_modified = make_number (0);
   windows_or_buffers_changed++;
-  FRAME_WINDOW_SIZES_CHANGED (XFRAME (WINDOW_FRAME (w))) = 1;
+  FRAME_WINDOW_SIZES_CHANGED (XFRAME (w->frame)) = 1;
 
   if (width_p)
     {
       sideward = &w->vchild;
       forward = &w->hchild;
-      XSETFASTINT (w->width, size);
+      w->width = make_number (size);
     }
   else
     {
       sideward = &w->hchild;
       forward = &w->vchild;
-      XSETFASTINT (w->height, size);
+      w->height = make_number (size);
     }
 
   if (!NILP (*sideward))