diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | locale/hashval.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index a83e5f66fb..2963c38af6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-09-23 Joseph Myers <joseph@codesourcery.com> + + * locale/hashval.h (compute_hashval): Interpret bytes of key as + unsigned char. + 2013-09-23 Maciej W. Rozycki <macro@codesourcery.com> * manual/threads.texi (POSIX Threads): Fix a typo. diff --git a/locale/hashval.h b/locale/hashval.h index 737162f6b8..88e7839386 100644 --- a/locale/hashval.h +++ b/locale/hashval.h @@ -37,7 +37,7 @@ compute_hashval (const void *key, size_t keylen) while (cnt < keylen) { hval = (hval << 9) | (hval >> (sizeof hval * CHAR_BIT - 9)); - hval += (hashval_t) *(((char *) key) + cnt++); + hval += (hashval_t) ((const unsigned char *) key)[cnt++]; } return hval != 0 ? hval : ~((hashval_t) 0); } |