From 048ee7031d8598913e778b9d4de6097584e48971 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 2 Dec 2013 14:23:59 +0200 Subject: atom: allow passing NULLs to find_node_pointer() Signed-off-by: Ran Benita --- src/atom.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/atom.c') diff --git a/src/atom.c b/src/atom.c index 422f93e..5d86cf9 100644 --- a/src/atom.c +++ b/src/atom.c @@ -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; -- cgit v1.2.1