summaryrefslogtreecommitdiff
path: root/misc/hsearch_r.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-02-04 22:36:03 +0000
committerJakub Jelinek <jakub@redhat.com>2009-02-04 22:36:03 +0000
commit73c5dd45bc405428148ee740cac61a1279fe57d4 (patch)
tree878555d8c116d7ac9cb716b79e10d240fde946a3 /misc/hsearch_r.c
parent23a4b43d6a98912d505458daeced44b22830a773 (diff)
Updated to fedora-glibc-20090204T2135cvs/fedora-glibc-2_9_90-3
Diffstat (limited to 'misc/hsearch_r.c')
-rw-r--r--misc/hsearch_r.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/misc/hsearch_r.c b/misc/hsearch_r.c
index c855a41846..6e32afc43e 100644
--- a/misc/hsearch_r.c
+++ b/misc/hsearch_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1995-1997,2002,2005,2007,2008
+/* Copyright (C) 1993,1995-1997,2002,2005,2007,2008,2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1993.
@@ -79,6 +79,10 @@ hcreate_r (nel, htab)
if (htab->table != NULL)
return 0;
+ /* We need a size of at least 3. Otherwise the hash functions we
+ use will not work. */
+ if (nel < 3)
+ nel = 3;
/* Change nel to the first prime number not smaller as nel. */
nel |= 1; /* make odd */
while (!isprime (nel))