summaryrefslogtreecommitdiff
path: root/tree23.c
diff options
context:
space:
mode:
Diffstat (limited to 'tree23.c')
-rw-r--r--tree23.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tree23.c b/tree23.c
index 7089c29..1905fbc 100644
--- a/tree23.c
+++ b/tree23.c
@@ -195,9 +195,8 @@ void *find23(tree23 *t, void *e, int (*cmp)(void *, void *)) {
node23 *n;
int c;
- if (t->root == NULL)
+ if (t == NULL || t->root == NULL)
return NULL;
-
n = t->root;
while (n) {
c = cmp(e, n->elems[0]);