about summary refs log tree commit diff
path: root/misc/hsearch_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc/hsearch_r.c')
-rw-r--r--misc/hsearch_r.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/misc/hsearch_r.c b/misc/hsearch_r.c
index 6e32afc43e..73b9565030 100644
--- a/misc/hsearch_r.c
+++ b/misc/hsearch_r.c
@@ -157,6 +157,8 @@ hsearch_r (item, action, retval, htab)
       hval <<= 4;
       hval += item.key[count];
     }
+  if (hval == 0)
+    ++hval;
 
   /* First hash function: simply take the modul but prevent zero. */
   idx = hval % htab->size + 1;