From: Brian Aker Date: Tue, 1 Jan 2013 02:20:53 +0000 (-0500) Subject: Update to stats in case of bad function call. X-Git-Tag: 1.0.16~20^2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=ca1d51126acacad64ed939fdabf5ed68fed52617;p=m6w6%2Flibmemcached Update to stats in case of bad function call. --- diff --git a/libmemcached/stats.cc b/libmemcached/stats.cc index eb337680..6bab673d 100644 --- a/libmemcached/stats.cc +++ b/libmemcached/stats.cc @@ -227,9 +227,21 @@ static memcached_return_t set_data(memcached_stat_st *memc_stat, const char *key return MEMCACHED_SUCCESS; } -char *memcached_stat_get_value(const memcached_st *ptr, memcached_stat_st *memc_stat, +char *memcached_stat_get_value(const memcached_st *, memcached_stat_st *memc_stat, const char *key, memcached_return_t *error) { + memcached_return_t not_used; + if (error == NULL) + { + error= ¬_used; + } + + if (memc_stat == NULL) + { + *error= MEMCACHED_INVALID_ARGUMENTS; + return NULL; + } + char buffer[SMALL_STRING_LEN]; int length;