]> Dogcows Code - chaz/openbox/commitdiff
fix using uninit'd memory. don't use 0 keycode
authorDana Jansens <danakj@orodu.net>
Wed, 9 May 2007 20:27:05 +0000 (20:27 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 9 May 2007 20:27:05 +0000 (20:27 +0000)
openbox/modkeys.c

index 4eb836e5114548527f2c7bb3a4c71a88ef1031cd..70605511957b1886d6fe7ab5bc882693fe19f0e3 100644 (file)
@@ -64,12 +64,17 @@ void modkeys_startup(gboolean reconfigure)
             KeySym sym;
             /* get a keycode that is bound to the mask (i) */
             KeyCode keycode = modmap->modifiermap[i*modmap->max_keypermod + j];
-            /* go through each keysym bound to the given keycode */
-            for (k = 0; k < keysyms_per_keycode; ++k) {
-                sym = keymap[(keycode-min_keycode) * keysyms_per_keycode + k];
-                if (sym != NoSymbol) {
-                    /* bind the key to the mask (e.g. Alt_L => Mod1Mask) */
-                    set_modkey_mask(nth_mask(i), sym);
+            g_print("keycode %d for mask %d\n", keycode, i);
+            if (keycode) {
+                /* go through each keysym bound to the given keycode */
+                for (k = 0; k < keysyms_per_keycode; ++k) {
+                    sym = keymap[(keycode-min_keycode) * keysyms_per_keycode +
+                                 k];
+                    g_print("k %d sym %s \n", k, XKeysymToString(sym));
+                    if (sym != NoSymbol) {
+                        /* bind the key to the mask (e.g. Alt_L => Mod1Mask) */
+                        set_modkey_mask(nth_mask(i), sym);
+                    }
                 }
             }
         }
This page took 0.026769 seconds and 4 git commands to generate.