Standardize the snprintf() failure messages, and add tests for libmemcached_util_getpid()
[awesomized/libmemcached] / libmemcached / delete.cc
index 7ef05b07aef8f756945bc3e179e6aa1e52c1d8f2..de4a53dc46a51931b3ce96e84f271ed0d3f13d36 100644 (file)
@@ -150,7 +150,8 @@ memcached_return_t memcached_delete_by_key(memcached_st *ptr,
 
     if (send_length >= MEMCACHED_DEFAULT_COMMAND_SIZE || send_length < 0)
     {
-      rc= MEMCACHED_WRITE_FAILURE;
+      rc=  memcached_set_error(*ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT, 
+                               memcached_literal_param("snprintf(MEMCACHED_DEFAULT_COMMAND_SIZE)"));
       goto error;
     }