aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tucker@tuckerevans.com>2020-07-06 21:13:49 -0400
committerTucker Evans <tucker@tuckerevans.com>2020-07-08 11:03:58 -0400
commitd165f723621fcbed677d879e188a1a162812f667 (patch)
treeac5a0c0936be51d5eb3ea858f6c4f7211946f83b
parent15de5dc2c5d82e816cd9c0a7c56b7e1d4165717f (diff)
Fix access node's key not passed key for maps index/insert
-rw-r--r--collections/map/map.c4
1 files 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);