[hackers] [st] fixed potential bug in IS_SET(). || Aurélien Aptel

From: <hg_AT_suckless.org>
Date: Thu, 26 Aug 2010 20:58:18 +0000 (UTC)

changeset: 96:7a97a8448401
tag: tip
user: Aurélien Aptel <aurelien.aptel_AT_gmail.com>
date: Fri Aug 27 00:58:28 2010 +0200
files: st.c
description:
fixed potential bug in IS_SET().

diff -r 5b60c57d2a18 -r 7a97a8448401 st.c
--- a/st.c Fri Aug 27 00:28:27 2010 +0200
+++ b/st.c Fri Aug 27 00:58:28 2010 +0200
@@ -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 };
Received on Thu Aug 26 2010 - 22:58:18 CEST

This archive was generated by hypermail 2.2.0 : Thu Aug 26 2010 - 23:00:07 CEST