size_t len= strlen(args);
memcached_return_t rc= memcached_validate_key_length(len, true);
- unlikely (rc != MEMCACHED_SUCCESS)
+ if (rc != MEMCACHED_SUCCESS)
+ {
return rc;
+ }
request.message.header.request.keylen= htons((uint16_t)len);
request.message.header.request.bodylen= htonl((uint32_t) len);
struct libmemcached_io_vector_st vector[]=
{
- { sizeof(request.bytes), request.bytes },
- { len, args }
+ { request.bytes, sizeof(request.bytes) },
+ { args, len }
};
if (memcached_vdo(instance, vector, 2, true) != MEMCACHED_SUCCESS)
string_ptr= end_ptr + 1;
for (end_ptr= string_ptr; !(isspace(*end_ptr)); end_ptr++) {};
value= string_ptr;
- value[(size_t)(end_ptr-string_ptr)]= 0;
- string_ptr= end_ptr + 2;
+ value[(size_t)(end_ptr -string_ptr)]= 0;
if (memc_stat)
{
unlikely((set_data(memc_stat, key, value)) == MEMCACHED_UNKNOWN_STAT_KEY)
memcached_stat_st *memcached_stat(memcached_st *self, char *args, memcached_return_t *error)
{
+ memcached_return_t unused;
+ if (error == NULL)
+ {
+ error= &unused;
+ }
+
memcached_return_t rc;
if (memcached_failed(rc= initialize_query(self)))
{
- if (error)
- *error= rc;
+ *error= rc;
return NULL;
}
WATCHPOINT_ASSERT(error);
- unlikely (self->flags.use_udp)
+ if (self->flags.use_udp)
{
- if (error)
- *error= MEMCACHED_NOT_SUPPORTED;
+ *error= memcached_set_error(*self, MEMCACHED_NOT_SUPPORTED, MEMCACHED_AT);
return NULL;
}
if (not stats)
{
- if (error)
- *error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;
+ *error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;
return NULL;
}
}
}
- if (error)
- *error= rc;
+ *error= rc;
return stats;
}
void memcached_stat_free(const memcached_st *, memcached_stat_st *memc_stat)
{
WATCHPOINT_ASSERT(memc_stat); // Be polite, but when debugging catch this as an error
- if (not memc_stat)
+ if (memc_stat == NULL)
{
return;
}