Standardize the snprintf() failure messages, and add tests for libmemcached_util_getpid()
[awesomized/libmemcached] / libmemcached / dump.cc
index d5aa292ae62104542e3abb1406581289b321d8e2..ef4a0ce388fa48b0e1e42883e0c5c3c279e4cbf2 100644 (file)
@@ -31,7 +31,8 @@ static memcached_return_t ascii_dump(memcached_st *ptr, memcached_dump_fn *callb
 
       if (send_length >= MEMCACHED_DEFAULT_COMMAND_SIZE || send_length < 0)
       {
-        return MEMCACHED_FAILURE;
+        return memcached_set_error(*ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT, 
+                                   memcached_literal_param("snprintf(MEMCACHED_DEFAULT_COMMAND_SIZE)"));
       }
 
       rc= memcached_do(instance, buffer, (size_t)send_length, true);