From 9351ece659f57ee704b5f0ccfd4b531677ff36f8 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 20 Jan 2020 16:31:51 +0100 Subject: [PATCH] libmemcached: memcached_purge (fix #62) --- libmemcached/purge.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libmemcached/purge.cc b/libmemcached/purge.cc index 5f6d4bb7..4646708e 100644 --- a/libmemcached/purge.cc +++ b/libmemcached/purge.cc @@ -111,8 +111,8 @@ bool memcached_purge(memcached_instance_st* ptr) WATCHPOINT_ASSERT(ptr->fd != INVALID_SOCKET); bool is_successful= true; - uint32_t no_msg= memcached_server_response_count(ptr) - 1; - if (no_msg > 0) + uint32_t no_msg= memcached_server_response_count(ptr); + if (no_msg > 1) { memcached_result_st result; @@ -126,7 +126,7 @@ bool memcached_purge(memcached_instance_st* ptr) memcached_result_st* result_ptr= memcached_result_create(root, &result); assert(result_ptr); - for (uint32_t x= 0; x < no_msg; x++) + for (uint32_t x= 0; x < no_msg - 1; x++) { memcached_result_reset(result_ptr); memcached_return_t rc= memcached_read_one_response(ptr, result_ptr); -- 2.30.2