Fixup of ccab349 - unlike the commit message, hash a byte twice instead
of zero times, which is probably better. This is how it was before.
Signed-off-by: Ran Benita <ran@unusedvar.com>
hash_buf(const char *string, size_t len)
{
uint32_t hash = 2166136261u;
- for (size_t i = 0; i < len / 2; i++) {
+ for (size_t i = 0; i < (len + 1) / 2; i++) {
hash ^= (uint8_t) string[i];
hash *= 0x01000193;
hash ^= (uint8_t) string[len - 1 - i];