~emersion/mrsh

442073258468d51704f72b33ba32d4b7be17227f — emersion 2 years ago 0092dfb
hashtable: fix mrsh_hashtable_set when appending to a bucket
1 files changed, 2 insertions(+), 1 deletions(-)

M hashtable.c
M hashtable.c => hashtable.c +2 -1
@@ 46,9 46,10 @@ void *mrsh_hashtable_set(struct mrsh_hashtable *table, const char *key,
		entry = calloc(1, sizeof(struct mrsh_hashtable_entry));
		entry->hash = hash;
		entry->key = strdup(key);
		table->buckets[bucket] = entry;
		if (previous != NULL) {
			previous->next = entry;
		} else {
			table->buckets[bucket] = entry;
		}
	}