X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Flibmemcached%2Fstorage.cc;h=31eadb1e2e9fa9aa8416a18ee673014f6c421854;hb=refs%2Fheads%2Fv1.x;hp=0404b1930fb4de95798fb69ab6f4a2517a369aa5;hpb=0f27cca46a4a529459ca988268972f480a9730c6;p=awesomized%2Flibmemcached diff --git a/src/libmemcached/storage.cc b/src/libmemcached/storage.cc index 0404b193..31eadb1e 100644 --- a/src/libmemcached/storage.cc +++ b/src/libmemcached/storage.cc @@ -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. | @@ -9,7 +9,7 @@ | the terms online at: https://opensource.org/licenses/BSD-3-Clause | +--------------------------------------------------------------------+ | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | - | Copyright (c) 2020 Michael Wallner | + | Copyright (c) 2020-2021 Michael Wallner https://awesome.co/ | +--------------------------------------------------------------------+ */ @@ -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"));