JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
removed XINERAMA from config.mk and fixed a segfault when st is
[st.git] / st.c
diff --git a/st.c b/st.c
index ebe896c..623ca29 100644 (file)
--- a/st.c
+++ b/st.c
@@ -34,7 +34,7 @@
 #define BETWEEN(x, a, b)  ((a) <= (x) && (x) <= (b))
 #define LIMIT(x, a, b)    (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x)
 #define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || (a).bg != (b).bg)
-#define IS_SET(flag) (term.mode & flag)
+#define IS_SET(flag) (term.mode & (flag))
 
 /* Attribute, Cursor, Character state, Terminal mode, Screen draw mode */
 enum { ATTR_NULL=0 , ATTR_REVERSE=1 , ATTR_UNDERLINE=2, ATTR_BOLD=4, ATTR_GFX=8 };
@@ -1078,10 +1078,9 @@ xhints(void)
 
 void
 xinit(void) {
-       xw.dis = XOpenDisplay(NULL);
-       xw.scr = XDefaultScreen(xw.dis);
-       if(!xw.dis)
+       if(!(xw.dis = XOpenDisplay(NULL)))
                die("Can't open display\n");
+       xw.scr = XDefaultScreen(xw.dis);
        
        /* font */
        if(!(dc.font = XLoadQueryFont(xw.dis, FONT)) || !(dc.bfont = XLoadQueryFont(xw.dis, BOLDFONT)))