From d165f723621fcbed677d879e188a1a162812f667 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Mon, 6 Jul 2020 21:13:49 -0400 Subject: Fix access node's key not passed key for maps index/insert --- collections/map/map.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collections/map/map.c b/collections/map/map.c index 0600c8b..a476a97 100644 --- a/collections/map/map.c +++ b/collections/map/map.c @@ -54,7 +54,7 @@ void *key, *val; if (!root) return -1; - if (!key) { + if (!root->key) { root->key = key; root->val = val; return 0; @@ -110,7 +110,7 @@ map *root; void *key; { int cmp; - if (!root || !key) + if (!root || !root->key) return NULL; cmp = root->cmp(root->key, key); -- cgit v1.1