1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

(__hash_string): Zero-extend each char from the string; the old code did a sign-extend on some platforms.

This commit is contained in:
Ulrich Drepper
2003-10-24 03:22:26 +00:00
parent e97bfee1b1
commit d0f1175e94

View File

@ -35,7 +35,7 @@ __hash_string (str_param)
while (*str != '\0') while (*str != '\0')
{ {
hval <<= 4; hval <<= 4;
hval += (unsigned long int) *str++; hval += (unsigned char) *str++;
g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4)); g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4));
if (g != 0) if (g != 0)
{ {