Skip to content

Commit

Permalink
map: set errno to ENOENT if prefix for map_closest does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
martanne committed Feb 18, 2016
1 parent 951cfa3 commit efc64e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion map.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void *map_closest(const Map *map, const char *prefix)
if (v)
return v;
const Map *m = map_prefix(map, prefix);
if (!m->v)
if (map_empty(m))
errno = ENOENT;
return m->v;
}
Expand Down

0 comments on commit efc64e5

Please sign in to comment.