X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fstats.cc;h=eb2904438e746223ff399d5dbde01dcfce6e7555;hb=b9abfad1cd433c8c188ca559ba3858798fe3d187;hp=08934ba67960f697f8f03b000fa87e31ced5cc45;hpb=ae6bc7501efd5aeaaee92dabe2da0ec2d1625c5b;p=m6w6%2Flibmemcached diff --git a/libmemcached/stats.cc b/libmemcached/stats.cc index 08934ba6..eb290443 100644 --- a/libmemcached/stats.cc +++ b/libmemcached/stats.cc @@ -77,7 +77,7 @@ static memcached_return_t set_data(memcached_stat_st *memc_stat, char *key, char else if (!strcmp("rusage_user", key)) { char *walk_ptr; - for (walk_ptr= value; (!ispunct(*walk_ptr)); walk_ptr++); + for (walk_ptr= value; (!ispunct(*walk_ptr)); walk_ptr++) {}; *walk_ptr= 0; walk_ptr++; memc_stat->rusage_user_seconds= (uint32_t) strtol(value, (char **)NULL, 10); @@ -86,7 +86,7 @@ static memcached_return_t set_data(memcached_stat_st *memc_stat, char *key, char else if (!strcmp("rusage_system", key)) { char *walk_ptr; - for (walk_ptr= value; (!ispunct(*walk_ptr)); walk_ptr++); + for (walk_ptr= value; (!ispunct(*walk_ptr)); walk_ptr++) {}; *walk_ptr= 0; walk_ptr++; memc_stat->rusage_system_seconds= (uint32_t) strtol(value, (char **)NULL, 10); @@ -371,12 +371,12 @@ static memcached_return_t ascii_stats_fetch(memcached_stat_st *memc_stat, string_ptr= buffer; string_ptr+= 5; /* Move past STAT */ - for (end_ptr= string_ptr; isgraph(*end_ptr); end_ptr++); + for (end_ptr= string_ptr; isgraph(*end_ptr); end_ptr++) {}; key= string_ptr; key[(size_t)(end_ptr-string_ptr)]= 0; string_ptr= end_ptr + 1; - for (end_ptr= string_ptr; !(isspace(*end_ptr)); end_ptr++); + for (end_ptr= string_ptr; !(isspace(*end_ptr)); end_ptr++) {}; value= string_ptr; value[(size_t)(end_ptr-string_ptr)]= 0; string_ptr= end_ptr + 2; @@ -398,7 +398,9 @@ static memcached_return_t ascii_stats_fetch(memcached_stat_st *memc_stat, } } else + { break; + } } error: @@ -550,15 +552,10 @@ void memcached_stat_free(const memcached_st *ptr, memcached_stat_st *memc_stat) if (memc_stat->root) { libmemcached_free(memc_stat->root, memc_stat); + return; } - else if (ptr) - { - libmemcached_free(ptr, memc_stat); - } - else - { - free(memc_stat); - } + + libmemcached_free(ptr, memc_stat); } static memcached_return_t call_stat_fn(memcached_st *ptr,