about summary refs log tree commit diff
path: root/locale/elem-hash.h
diff options
context:
space:
mode:
Diffstat (limited to 'locale/elem-hash.h')
-rw-r--r--locale/elem-hash.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/locale/elem-hash.h b/locale/elem-hash.h
index f68e764731..9efe8d1385 100644
--- a/locale/elem-hash.h
+++ b/locale/elem-hash.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Ulrich Drepper, <drepper@cygnus.com>.
 
@@ -24,10 +24,10 @@ elem_hash (const char *str, int_fast32_t n)
 {
   int32_t result = n;
 
-  while (n > 0)
+  while (n-- > 0)
     {
-      n <<= 3;
-      n += *str++;
+      result <<= 3;
+      result += *str++;
     }
 
   return result;