fix hashtable iteration in h_hashtable_update

This commit is contained in:
Sven M. Hallberg 2013-05-05 19:32:23 +02:00
parent 916027a55f
commit 2f81c2b400

View file

@ -171,6 +171,8 @@ void h_hashtable_update(HHashTable *dst, const HHashTable *src) {
HHashTableEntry *hte; HHashTableEntry *hte;
for(i=0; i < src->capacity; i++) { for(i=0; i < src->capacity; i++) {
for(hte = &src->contents[i]; hte; hte = hte->next) { for(hte = &src->contents[i]; hte; hte = hte->next) {
if(hte->key == NULL)
continue;
h_hashtable_put(dst, hte->key, hte->value); h_hashtable_put(dst, hte->key, hte->value);
} }
} }