From: Brian Aker Date: Mon, 17 Dec 2007 22:09:40 +0000 (-0800) Subject: Fix for when CRC return 0. X-Git-Tag: 0.13~25 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=b53a28a5a43839a128b6f583830c09024cabe717;p=m6w6%2Flibmemcached Fix for when CRC return 0. --- 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: