Commit 9b1a68eca92cf964bbfbbe5bf9ee9c5ef2496c8f

Ran Benita 2014-04-22T11:22:22

keymap: protect xkb_foreach_key macro params Signed-off-by: Ran Benita <ran234@gmail.com>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/keymap.h b/src/keymap.h
index 71d5ca0..dd6bde6 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -398,9 +398,9 @@ struct xkb_keymap {
 };
 
 #define xkb_foreach_key(iter, keymap) \
-    for (iter = keymap->keys + keymap->min_key_code; \
-         iter <= keymap->keys + keymap->max_key_code; \
-         iter++)
+    for ((iter) = (keymap)->keys + (keymap)->min_key_code; \
+         (iter) <= (keymap)->keys + (keymap)->max_key_code; \
+         (iter)++)
 
 static inline const struct xkb_key *
 XkbKey(struct xkb_keymap *keymap, xkb_keycode_t kc)