X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fcommon.h;h=d4b2c7df3446660f26307541ec29a3560068767d;hb=0a45c8bafd621482cb08f2e5f792f42cafb13865;hp=f30589ca8be21382c9a76daedec406149ff54af5;hpb=c87f1a554cce74ac1ba3d4e7e9c2a1d2904e4766;p=m6w6%2Flibmemcached diff --git a/libmemcached/common.h b/libmemcached/common.h index f30589ca..d4b2c7df 100644 --- a/libmemcached/common.h +++ b/libmemcached/common.h @@ -103,6 +103,7 @@ memcached_return_t memcached_server_execute(memcached_st *ptr, #include #ifdef __cplusplus +#include #include #endif @@ -168,20 +169,24 @@ LIBMEMCACHED_LOCAL static inline memcached_return_t memcached_validate_key_length(size_t key_length, bool binary) { - unlikely (key_length == 0) + if (key_length == 0) { return MEMCACHED_BAD_KEY_PROVIDED; } if (binary) { - unlikely (key_length > 0xffff) + if (key_length > 0xffff) + { return MEMCACHED_BAD_KEY_PROVIDED; + } } else { - unlikely (key_length >= MEMCACHED_MAX_KEY) + if (key_length >= MEMCACHED_MAX_KEY) + { return MEMCACHED_BAD_KEY_PROVIDED; + } } return MEMCACHED_SUCCESS;