summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-02-21 21:10:00 +0100
committerRichard Braun <rbraun@sceen.net>2018-02-21 21:10:00 +0100
commita484ccff7df6300378a0a62238fa6082879a3888 (patch)
tree4140288058db0035b5c48be3dba6b782b44a70f2
parent851ee2ce684cba1d03274abbdab879473ad7e308 (diff)
hash: fix hash_str with large values of bits
Reported by Laurent Dufresne.
-rw-r--r--src/hash.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hash.h b/src/hash.h
index 9909ee4..2af2de1 100644
--- a/src/hash.h
+++ b/src/hash.h
@@ -118,7 +118,7 @@ hash_str(const char *str, unsigned int bits)
hash = ((hash << 5) - hash) + c;
}
- return hash & ((1 << bits) - 1);
+ return hash & ((1UL << bits) - 1);
}
#endif /* _HASH_H */