From 97de2eaf845eed07e5e6e05d7f2509ca04911de0 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Fri, 28 Dec 2012 16:01:51 -0500 Subject: [PATCH] Style cleanup. --- libmemcached/string.cc | 19 ++++++++++++------- libtest/comparison.hpp | 8 ++++---- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/libmemcached/string.cc b/libmemcached/string.cc index 1c44e996..89b33e11 100644 --- a/libmemcached/string.cc +++ b/libmemcached/string.cc @@ -279,16 +279,21 @@ const char *memcached_string_value(const memcached_string_st& self) char *memcached_string_take_value(memcached_string_st *self) { - assert_msg(self, "Invalid memcached_string_st"); - // If we fail at adding the null, we copy and move on - if (memcached_success(memcached_string_append_null(self))) + char* value= NULL; + + if (memcached_string_length(self)) { - return memcached_string_c_copy(self); - } + assert_msg(self, "Invalid memcached_string_st"); + // If we fail at adding the null, we copy and move on + if (memcached_success(memcached_string_append_null(self))) + { + return memcached_string_c_copy(self); + } - char *value= self->string; + value= self->string; - _init_string(self); + _init_string(self); + } return value; } diff --git a/libtest/comparison.hpp b/libtest/comparison.hpp index 5b3172a1..d75e97fc 100644 --- a/libtest/comparison.hpp +++ b/libtest/comparison.hpp @@ -39,13 +39,13 @@ #include #if defined(HAVE_LIBMEMCACHED) && HAVE_LIBMEMCACHED -#include -#include -#include +# include +# include +# include #endif #if defined(HAVE_LIBGEARMAN) && HAVE_LIBGEARMAN -#include +# include #endif namespace libtest { -- 2.30.2