From c2d5bd5b00cfbb0ef192821f2d724fb6448d59e3 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 24 Apr 2009 18:20:10 +0000 Subject: [BZ #10100] 2009-04-24 Ulrich Drepper [BZ #10100] * misc/hsearch_r.c (hsearch_r): Add back ensurance that hval is not zero. --- misc/hsearch_r.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'misc/hsearch_r.c') 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; -- cgit 1.4.1