aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorGerd Moellmann2000-10-24 14:05:50 +0000
committerGerd Moellmann2000-10-24 14:05:50 +0000
commit7ae2f10f738ad485fba621f4f2cb175e1c8d2794 (patch)
tree8637c52b2884c7dfbd7eb14b86903da11baf3843 /src/window.c
parent5b370c2bad5d308ab42ee63aa35835362782db75 (diff)
downloademacs-7ae2f10f738ad485fba621f4f2cb175e1c8d2794.tar.gz
emacs-7ae2f10f738ad485fba621f4f2cb175e1c8d2794.zip
(size_window): Prevent setting window's width or
height to a negative value (esp. with XSETFASTINT).
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/window.c b/src/window.c
index 36f857e6465..3f08e64a26b 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2314,6 +2314,7 @@ size_window (window, size, width_p, nodelete_p)
2314 int old_size, min_size; 2314 int old_size, min_size;
2315 2315
2316 check_min_window_sizes (); 2316 check_min_window_sizes ();
2317 size = max (0, size);
2317 2318
2318 /* If the window has been "too small" at one point, 2319 /* If the window has been "too small" at one point,
2319 don't delete it for being "too small" in the future. 2320 don't delete it for being "too small" in the future.
@@ -2350,22 +2351,22 @@ size_window (window, size, width_p, nodelete_p)
2350 } 2351 }
2351 2352
2352 /* Set redisplay hints. */ 2353 /* Set redisplay hints. */
2353 XSETFASTINT (w->last_modified, 0); 2354 w->last_modified = make_number (0);
2354 XSETFASTINT (w->last_overlay_modified, 0); 2355 w->last_overlay_modified = make_number (0);
2355 windows_or_buffers_changed++; 2356 windows_or_buffers_changed++;
2356 FRAME_WINDOW_SIZES_CHANGED (XFRAME (WINDOW_FRAME (w))) = 1; 2357 FRAME_WINDOW_SIZES_CHANGED (XFRAME (w->frame)) = 1;
2357 2358
2358 if (width_p) 2359 if (width_p)
2359 { 2360 {
2360 sideward = &w->vchild; 2361 sideward = &w->vchild;
2361 forward = &w->hchild; 2362 forward = &w->hchild;
2362 XSETFASTINT (w->width, size); 2363 w->width = make_number (size);
2363 } 2364 }
2364 else 2365 else
2365 { 2366 {
2366 sideward = &w->hchild; 2367 sideward = &w->hchild;
2367 forward = &w->vchild; 2368 forward = &w->vchild;
2368 XSETFASTINT (w->height, size); 2369 w->height = make_number (size);
2369 } 2370 }
2370 2371
2371 if (!NILP (*sideward)) 2372 if (!NILP (*sideward))