Code

Warning cleanup.
[inkscape.git] / src / shortcuts.cpp
index cf7f485c6d9197bb94c51942b286f00dce1eb642..7d0f3747d044153a9a56f64af47551491b15d4a6 100644 (file)
@@ -23,6 +23,8 @@
 #endif
 
 #include <vector>
+#include <cstring>
+#include <string>
 
 #include <gdk/gdkkeys.h>
 #include <gdk/gdkkeysyms.h>
@@ -117,13 +119,13 @@ static void read_shortcuts_file(char const *filename) {
         }
 
         gchar const *keyval_name=iter->attribute("key");
-        if (!keyval_name) {
+        if (!keyval_name || !*keyval_name) {
             // that's ok, it's just listed for reference without assignment, skip it
             continue;
         }
 
         guint keyval=gdk_keyval_from_name(keyval_name);
-        if (keyval == GDK_VoidSymbol) {
+        if (keyval == GDK_VoidSymbol || keyval == 0) {
             g_warning("Unknown keyval %s for %s", keyval_name, verb_name);
             continue;
         }