Style cleanup.
authorBrian Aker <brian@tangent.org>
Fri, 28 Dec 2012 21:01:51 +0000 (16:01 -0500)
committerBrian Aker <brian@tangent.org>
Fri, 28 Dec 2012 21:01:51 +0000 (16:01 -0500)
libmemcached/string.cc
libtest/comparison.hpp

index 1c44e996d680e46e7143463fe51b15aa09e7cf93..89b33e1180069707c1396c9e2ea9a5f05894f4a6 100644 (file)
@@ -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;
 }
index 5b3172a10ad557d7f0f9a37fdfcdb21bd6910a1e..d75e97fc93e89dc354eebe289c6015141f1b3044 100644 (file)
 #include <typeinfo>
 
 #if defined(HAVE_LIBMEMCACHED) && HAVE_LIBMEMCACHED
-#include <libmemcached-1.0/memcached.h>
-#include <libmemcachedutil-1.0/ostream.hpp>
-#include <libtest/memcached.hpp>
+# include <libmemcached-1.0/memcached.h>
+# include <libmemcachedutil-1.0/ostream.hpp>
+# include <libtest/memcached.hpp>
 #endif
 
 #if defined(HAVE_LIBGEARMAN) && HAVE_LIBGEARMAN
-#include <libgearman-1.0/ostream.hpp>
+# include <libgearman-1.0/ostream.hpp>
 #endif
 
 namespace libtest {