summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2001-11-19 10:41:32 +0000
committerThomas Roessler <roessler@does-not-exist.org>2001-11-19 10:41:32 +0000
commite554325940bef9d26a4d05cc9b8263216dd9e5fb (patch)
treeea0ef15931ada16a7930f711035678c30cddc098 /hash.c
parenta8a51d7e3f9549b18c407c0a6838442afd2e5bce (diff)
Fix #868, #876. Work-around from Len Lattanzi
<len@mss.migration.com>.
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c2
1 files changed, 2 insertions, 0 deletions
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;