atom: allow passing NULLs to find_node_pointer()
authorRan Benita <ran234@gmail.com>
Mon, 2 Dec 2013 12:23:59 +0000 (14:23 +0200)
committerRan Benita <ran234@gmail.com>
Mon, 2 Dec 2013 12:26:37 +0000 (14:26 +0200)
Signed-off-by: Ran Benita <ran234@gmail.com>
src/atom.c

index 422f93e..5d86cf9 100644 (file)
@@ -171,8 +171,10 @@ find_node_pointer(struct atom_table *table, const char *string, size_t len,
         }
     }
 
-    *fingerprint_out = fingerprint;
-    *nodep_out = nodep;
+    if (fingerprint_out)
+        *fingerprint_out = fingerprint;
+    if (nodep_out)
+        *nodep_out = nodep;
     return found;
 }
 
@@ -180,12 +182,11 @@ xkb_atom_t
 atom_lookup(struct atom_table *table, const char *string, size_t len)
 {
     struct atom_node **nodep;
-    unsigned int fingerprint;
 
     if (!string)
         return XKB_ATOM_NONE;
 
-    if (!find_node_pointer(table, string, len, &nodep, &fingerprint))
+    if (!find_node_pointer(table, string, len, &nodep, NULL))
         return XKB_ATOM_NONE;
 
     return (*nodep)->atom;