symbols: fix possible use of uninitialized value
authorRan Benita <ran234@gmail.com>
Sat, 22 Feb 2014 21:20:04 +0000 (23:20 +0200)
committerRan Benita <ran234@gmail.com>
Sat, 22 Feb 2014 21:45:31 +0000 (23:45 +0200)
Nothing bad can come out of it, but for some reason this error didn't
return early (inherited from xkbcomp).
Also promote the log message to an error, as it clearly is.

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

index eda8b8e..7ff8b71 100644 (file)
@@ -786,10 +786,12 @@ SetSymbolsField(SymbolsInfo *info, KeyInfo *keyi, const char *field,
         xkb_layout_index_t ndx;
         xkb_atom_t val;
 
-        if (!ExprResolveString(ctx, value, &val))
-            log_vrb(ctx, 1,
+        if (!ExprResolveString(ctx, value, &val)) {
+            log_err(ctx,
                     "The type field of a key symbol map must be a string; "
                     "Ignoring illegal type definition\n");
+            return false;
+        }
 
         if (arrayNdx == NULL) {
             keyi->default_type = val;