From: Bruno Haible Date: Fri, 24 Oct 2003 10:25:23 +0000 (+0000) Subject: Use zero-extend so that the hash code for non-ASCII msgids doesn't X-Git-Tag: v0.13~188 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3697d5dbaa9b3a2558bfac0700e18480d477872c;p=thirdparty%2Fgettext.git Use zero-extend so that the hash code for non-ASCII msgids doesn't depend on the platform. --- diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 1521e3df6..5651e79e0 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,8 @@ +2003-10-19 Bruno Haible + + * 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 * vasnprintf.c (VASNPRINTF): Work around losing snprintf on HPUX 10.20. diff --git a/gettext-runtime/intl/hash-string.h b/gettext-runtime/intl/hash-string.h index 9be55eabd..093e3b1c1 100644 --- a/gettext-runtime/intl/hash-string.h +++ b/gettext-runtime/intl/hash-string.h @@ -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) {