]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Use zero-extend so that the hash code for non-ASCII msgids doesn't
authorBruno Haible <bruno@clisp.org>
Fri, 24 Oct 2003 10:25:23 +0000 (10:25 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:11:06 +0000 (12:11 +0200)
depend on the platform.

gettext-runtime/intl/ChangeLog
gettext-runtime/intl/hash-string.h

index 1521e3df627fbbaf3c324ef24d46a8b978080d49..5651e79e0694b9e9c7acd5ccecd99343544ba44c 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-19  Bruno Haible  <bruno@clisp.org>
+
+       * hash-string.h (hash_string): Zero-extend each char from the string;
+       the old code did a sign-extend on some platforms.
+
 2003-10-19  Jim Meyering  <jim@meyering.net>
 
        * vasnprintf.c (VASNPRINTF): Work around losing snprintf on HPUX 10.20.
index 9be55eabdbce0e2fa83bc0a82664cf4901f8e569..093e3b1c1036c2972d51a323a8c358aaecc0a840 100644 (file)
@@ -36,7 +36,7 @@ hash_string (const char *str_param)
   while (*str != '\0')
     {
       hval <<= 4;
-      hval += (unsigned long int) *str++;
+      hval += (unsigned char) *str++;
       g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4));
       if (g != 0)
        {