From: Date: Wed, 25 Jun 2008 06:44:13 +0000 (-0700) Subject: Simple fix in stats. X-Git-Tag: 0.22~6^2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=901d63226e7c2385b6f169f9f09007f65a0c2fe4;p=m6w6%2Flibmemcached Simple fix in stats. --- diff --git a/libmemcached/memcached_stats.c b/libmemcached/memcached_stats.c index cf3adc12..2223672f 100644 --- a/libmemcached/memcached_stats.c +++ b/libmemcached/memcached_stats.c @@ -84,6 +84,14 @@ static void set_data(memcached_stat_st *stat, char *key, char *value) { stat->total_items= strtol(value, (char **)NULL, 10); } + else if (!strcmp("bytes_read", key)) + { + stat->bytes_read= strtoll(value, (char **)NULL, 10); + } + else if (!strcmp("bytes_written", key)) + { + stat->bytes_written= strtoll(value, (char **)NULL, 10); + } else if (!strcmp("bytes", key)) { stat->bytes= strtoll(value, (char **)NULL, 10); @@ -120,14 +128,6 @@ static void set_data(memcached_stat_st *stat, char *key, char *value) { stat->evictions= (uint64_t)strtoll(value, (char **)NULL, 10); } - else if (!strcmp("bytes_read", key)) - { - stat->bytes_read= strtoll(value, (char **)NULL, 10); - } - else if (!strcmp("bytes_written", key)) - { - stat->bytes_written= strtoll(value, (char **)NULL, 10); - } else if (!strcmp("limit_maxbytes", key)) { stat->limit_maxbytes= strtoll(value, (char **)NULL, 10); diff --git a/libmemcached/memcached_string.h b/libmemcached/memcached_string.h index 350d1b51..44e52cad 100644 --- a/libmemcached/memcached_string.h +++ b/libmemcached/memcached_string.h @@ -16,10 +16,10 @@ extern "C" { struct memcached_string_st { memcached_st *root; memcached_allocated is_allocated; - char *string; char *end; size_t current_size; size_t block_size; + char *string; }; #define memcached_string_length(A) (size_t)((A)->end - (A)->string)