summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string.c b/string.c
index 7090140614..d511297089 100644
--- a/string.c
+++ b/string.c
@@ -845,14 +845,14 @@ rb_str_hash(VALUE str)
{
register long len = RSTRING(str)->len;
register char *p = RSTRING(str)->ptr;
- register int hval = FNV1_32A_INIT;
+ register unsigned int hval = FNV1_32A_INIT;
/*
* FNV-1a hash each octet in the buffer
*/
while (len--) {
/* xor the bottom with the current octet */
- hval ^= (int)*p++;
+ hval ^= (unsigned int)*p++;
/* multiply by the 32 bit FNV magic prime mod 2^32 */
#if defined(FNV_GCC_OPTIMIZATION)