Merge pull request #140 from hussainnaqvee/patch-1
[awesomized/libmemcached] / src / libmemcached / storage.cc
index fb8891791eb72a50912b44e61c5a1c07243fbdf0..31eadb1e2e9fa9aa8416a18ee673014f6c421854 100644 (file)
@@ -1,6 +1,6 @@
 /*
     +--------------------------------------------------------------------+
-    | libmemcached - C/C++ Client Library for memcached                  |
+    | libmemcached-awesome - C/C++ Client Library for memcached          |
     +--------------------------------------------------------------------+
     | Redistribution and use in source and binary forms, with or without |
     | modification, are permitted under the terms of the BSD license.    |
@@ -42,7 +42,7 @@ static inline const char *storage_op_string(memcached_storage_action_t verb) {
   return "set ";
 }
 
-static inline bool can_by_encrypted(const memcached_storage_action_t verb) {
+static inline bool can_be_encrypted(const memcached_storage_action_t verb) {
   switch (verb) {
   case SET_OP:
   case ADD_OP:
@@ -189,9 +189,9 @@ memcached_send_ascii(Memcached *ptr, memcached_instance_st *instance, const char
         memcached_literal_param("snprintf(MEMCACHED_MAXIMUM_INTEGER_DISPLAY_LENGTH)"));
   }
 
-  char expiration_buffer[MEMCACHED_MAXIMUM_INTEGER_DISPLAY_LENGTH + 1];
-  int expiration_buffer_length = snprintf(expiration_buffer, sizeof(expiration_buffer), " %llu",
-                                          (unsigned long long) expiration);
+  char expiration_buffer[MEMCACHED_MAXIMUM_INTEGER_DISPLAY_LENGTH + 1 + 1];
+  int expiration_buffer_length = snprintf(expiration_buffer, sizeof(expiration_buffer), " %lld",
+                                          (long long) expiration);
   if (size_t(expiration_buffer_length) >= sizeof(expiration_buffer) or expiration_buffer_length < 0)
   {
     return memcached_set_error(
@@ -296,7 +296,7 @@ memcached_send(memcached_st *shell, const char *group_key, size_t group_key_leng
   hashkit_string_st *destination = NULL;
 
   if (memcached_is_encrypted(ptr)) {
-    if (can_by_encrypted(verb) == false) {
+    if (can_be_encrypted(verb) == false) {
       return memcached_set_error(
           *ptr, MEMCACHED_NOT_SUPPORTED, MEMCACHED_AT,
           memcached_literal_param("Operation not allowed while encyrption is enabled"));