keycodes: fix uninitialized variable
authorRan Benita <ran234@gmail.com>
Thu, 24 Apr 2014 22:14:31 +0000 (01:14 +0300)
committerRan Benita <ran234@gmail.com>
Thu, 24 Apr 2014 22:14:31 +0000 (01:14 +0300)
Happened in one of the previous commits. For some reason, gcc doesn't
warn about this, but clang does...

Signed-off-by: Ran Benita <ran234@gmail.com>
src/xkbcomp/keycodes.c

index c05ad24..d2ff9d2 100644 (file)
@@ -72,7 +72,7 @@ static LedNameInfo *
 FindLedByName(KeyNamesInfo *info, xkb_atom_t name,
               xkb_led_index_t *idx_out)
 {
-    for (xkb_led_index_t idx; idx < info->num_led_names; idx++) {
+    for (xkb_led_index_t idx = 0; idx < info->num_led_names; idx++) {
         LedNameInfo *ledi = &info->led_names[idx];
         if (ledi->name == name) {
             *idx_out = idx;