[hackers] [st] fix crash for small windows || pancake

From: <hg_AT_suckless.org>
Date: Tue, 31 Aug 2010 09:45:15 +0000 (UTC)

changeset: 118:73d658f4ca2b
tag: tip
user: pancake_AT_nopcode.org
date: Tue Aug 31 11:40:57 2010 +0200
files: st.c
description:
fix crash for small windows
use unconditional infinite loops

diff -r 136a08071be7 -r 73d658f4ca2b st.c
--- a/st.c Tue Aug 31 11:02:17 2010 +0200
+++ b/st.c Tue Aug 31 11:40:57 2010 +0200
@@ -1422,6 +1422,10 @@
         tresize(col, row);
         ttyresize(col, row);
         XFreePixmap(xw.dis, xw.buf);
+ if(xw.bufh<1)
+ xw.bufh = 1;
+ if(xw.bufw<1)
+ xw.bufw = 1;
         xw.buf = XCreatePixmap(xw.dis, xw.win, xw.bufw, xw.bufh, XDefaultDepth(xw.dis, xw.scr));
         draw(SCREEN_REDRAW);
 }
@@ -1436,7 +1440,7 @@
         XSelectInput(xw.dis, xw.win, mask);
         XResizeWindow(xw.dis, xw.win, xw.w, xw.h); /* XXX: fix resize bug in wmii (?) */
 
- while(1) {
+ for(;;) {
                 FD_ZERO(&rfd);
                 FD_SET(cmdfd, &rfd);
                 FD_SET(xfd, &rfd);
Received on Tue Aug 31 2010 - 11:45:15 CEST

This archive was generated by hypermail 2.2.0 : Tue Aug 31 2010 - 11:48:04 CEST