X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Foptions%2Fcontext.h;fp=libmemcached%2Foptions%2Fcontext.h;h=226284d960ded8664d1105959a676f2f63a7a27a;hb=ae6bc7501efd5aeaaee92dabe2da0ec2d1625c5b;hp=bbca66c855e23600646de64c627a585c8f8b5e39;hpb=0f16555031c7f44d1acd034ff74e628c51a72dac;p=awesomized%2Flibmemcached diff --git a/libmemcached/options/context.h b/libmemcached/options/context.h index bbca66c8..226284d9 100644 --- a/libmemcached/options/context.h +++ b/libmemcached/options/context.h @@ -90,7 +90,7 @@ public: const char *set_hostname(const char *str, size_t size) { - size_t copy_length= std::min((size_t)NI_MAXHOST, size); + size_t copy_length= (size_t)NI_MAXHOST > size ? size : (size_t)NI_MAXHOST; memcpy(_hostname, str, copy_length); _hostname[copy_length]= 0;