X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fhashmap.c;fp=src%2Fshared%2Fhashmap.c;h=c4fde898f88ff3072dcfb7e090da375f249e886b;hb=bf3d3e2bb7ae2d3854be57f28dd1403c8f7e4c3c;hp=4c517059f68cbc1b3c7b41aaeae4192c3e4f359a;hpb=9ba81d5a61b7c992a1d2e5e02f334b8e2a0b0c22;p=elogind.git diff --git a/src/shared/hashmap.c b/src/shared/hashmap.c index 4c517059f..c4fde898f 100644 --- a/src/shared/hashmap.c +++ b/src/shared/hashmap.c @@ -886,15 +886,15 @@ int hashmap_move_one(Hashmap *h, Hashmap *other, const void *key) { unsigned h_hash, other_hash; struct hashmap_entry *e; - if (!other) - return 0; - assert(h); h_hash = bucket_hash(h, key); if (hash_scan(h, h_hash, key)) return -EEXIST; + if (!other) + return -ENOENT; + other_hash = bucket_hash(other, key); e = hash_scan(other, other_hash, key); if (!e)