summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shash.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/shash.h b/shash.h
index 69f5d61..e039ebb 100644
--- a/shash.h
+++ b/shash.h
@@ -43,7 +43,7 @@ StrHashEntry *shash_find(StrHashTable *h, strv_t key);
#define FNV_OFFSET_BASIS (hash_t)14695981039346656037LU
hash_t shash(strv_t s) {
hash_t h = FNV_OFFSET_BASIS;
- for (size_t i = 0; i < s.n; i++) h = (h ^ s.s[i]) * FNV_64_PRIME;
+ for (size_t i = 0; i < s.n; i++) h = (h ^ (s.s[i] & 255)) * FNV_64_PRIME;
return h;
}