From e554325940bef9d26a4d05cc9b8263216dd9e5fb Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Mon, 19 Nov 2001 10:41:32 +0000 Subject: [PATCH] Fix #868, #876. Work-around from Len Lattanzi . --- hash.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hash.c b/hash.c index 79e71539..a9b7b5d9 100644 --- a/hash.c +++ b/hash.c @@ -44,6 +44,8 @@ int hash_string (const unsigned char *s, int n) HASH *hash_create (int nelem) { HASH *table = safe_malloc (sizeof (HASH)); + if (nelem == 0) + nelem = 2; table->nelem = nelem; table->table = safe_calloc (nelem, sizeof (struct hash_elem *)); return table; -- 2.40.0