diff --git a/src/map.c b/src/map.c index 01c5046..618b891 100644 --- a/src/map.c +++ b/src/map.c @@ -358,10 +358,10 @@ cfw_map_set(CFWMap *map, void *key, void *obj) void cfw_map_iter(CFWMap *map, cfw_map_iter_t *iter) { - iter->key = NULL; - iter->obj = NULL; iter->_map = map; iter->_pos = 0; + + cfw_map_iter_next(iter); } void diff --git a/tests/tests.c b/tests/tests.c index f493657..75c3359 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -38,7 +38,6 @@ print_map(CFWMap *map) cfw_map_iter_t iter; cfw_map_iter(map, &iter); - cfw_map_iter_next(&iter); fputs("{\n", stdout);