Fixed compiler warning for wrong printf placeholder in memstat
[m6w6/libmemcached] / libmemcached / memcached_delete.c
index 3e1390fa56d71fe6e78874a79af664c6710a4106..84b6160c2fe00a4058aed9013df56fc981d2f741 100644 (file)
@@ -26,8 +26,10 @@ memcached_return memcached_delete_by_key(memcached_st *ptr,
 
   LIBMEMCACHED_MEMCACHED_DELETE_START();
 
-  unlikely (key_length == 0)
-    return MEMCACHED_NO_KEY_PROVIDED;
+  rc= memcached_validate_key_length(key_length, 
+                                    ptr->flags & MEM_BINARY_PROTOCOL);
+  unlikely (rc != MEMCACHED_SUCCESS)
+    return rc;
 
   unlikely (ptr->hosts == NULL || ptr->number_of_hosts == 0)
     return MEMCACHED_NO_SERVERS;
@@ -41,10 +43,10 @@ memcached_return memcached_delete_by_key(memcached_st *ptr,
   {
     if (expiration)
       send_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, 
-                            "delete %s%.*s %llu\r\n", 
+                            "delete %s%.*s %u\r\n", 
                             ptr->prefix_key,
                             (int)key_length, key, 
-                            (unsigned long long)expiration);
+                            (uint32_t)expiration);
     else
        send_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, 
                              "delete %s%.*s\r\n",