]> granicus.if.org Git - mutt/commitdiff
Fix #868, #876. Work-around from Len Lattanzi
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 19 Nov 2001 10:41:32 +0000 (10:41 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 19 Nov 2001 10:41:32 +0000 (10:41 +0000)
<len@mss.migration.com>.

hash.c

diff --git a/hash.c b/hash.c
index 79e71539bb1c551f18f278950dab678a129df474..a9b7b5d907cc99c674a7ffba75619a2cba756cf5 100644 (file)
--- 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;