From b53a28a5a43839a128b6f583830c09024cabe717 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Mon, 17 Dec 2007 14:09:40 -0800 Subject: [PATCH] Fix for when CRC return 0. --- lib/memcached_hash.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/memcached_hash.c b/lib/memcached_hash.c index 87c59d51..9906f5d9 100644 --- a/lib/memcached_hash.c +++ b/lib/memcached_hash.c @@ -29,6 +29,8 @@ unsigned int memcached_generate_hash(memcached_st *ptr, char *key, size_t key_le break; case MEMCACHED_HASH_CRC: hash= ((hash_crc32(key, key_length) >> 16) & 0x7fff); + if (hash == 0) + hash= 1; break; /* FNV hash'es lifted from Dustin Sallings work */ case MEMCACHED_HASH_FNV1_64: -- 2.30.2