From d6c5d19b66d61d9ca8293b31aaefe310ae691d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 25 Mar 2018 22:43:43 +0200 Subject: tree-wide: add bsearch_safe and use where appropriate Should fix #8557. --- src/hwdb/hwdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/hwdb') diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c index f579ef737e..6b450b4bb1 100644 --- a/src/hwdb/hwdb.c +++ b/src/hwdb/hwdb.c @@ -123,7 +123,7 @@ static struct trie_node *node_lookup(const struct trie_node *node, uint8_t c) { struct trie_child_entry search; search.c = c; - child = bsearch(&search, node->children, node->children_count, sizeof(struct trie_child_entry), trie_children_cmp); + child = bsearch_safe(&search, node->children, node->children_count, sizeof(struct trie_child_entry), trie_children_cmp); if (child) return child->child; return NULL; -- cgit v1.2.1