opt_expire= (time_t)strtoll(optarg, (char **)NULL, 10);
if (errno != 0)
{
- std::cerr << "Incorrect value passed to --expire: `" << optarg << "`" << std::cerr;
+ std::cerr << "Incorrect value passed to --expire: `" << optarg << "`" << std::endl;
exit(EXIT_FAILURE);
}
break;
opt_expire= time_t(strtoll(optarg, (char **)NULL, 10));
if (errno != 0)
{
- std::cerr << "Incorrect value passed to --expire: `" << optarg << "`" << std::cerr;
+ std::cerr << "Incorrect value passed to --expire: `" << optarg << "`" << std::endl;
exit(EXIT_FAILURE);
}
break;
opt_expire= (time_t)strtoll(optarg, (char **)NULL, 10);
if (errno != 0)
{
- std::cerr << "Incorrect value passed to --expire: `" << optarg << "`" << std::cerr;
+ std::cerr << "Incorrect value passed to --expire: `" << optarg << "`" << std::endl;
exit(EXIT_FAILURE);
}
break;
assert(server->type != MEMCACHED_CONNECTION_UNIX_SOCKET);
server->clear_addrinfo();
- char str_port[MEMCACHED_NI_MAXSERV];
+ char str_port[MEMCACHED_NI_MAXSERV]= { 0 };
+ errno= 0;
int length= snprintf(str_port, MEMCACHED_NI_MAXSERV, "%u", uint32_t(server->port()));
- if (length >= MEMCACHED_NI_MAXSERV or length <= 0)
+ if (length >= MEMCACHED_NI_MAXSERV or length <= 0 or errno != 0)
{
return memcached_set_error(*server, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT,
memcached_literal_param("snprintf(NI_MAXSERV)"));
case MEMCACHED_CONNECTION_TCP:
rc= network_connect(server);
+#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT
if (LIBMEMCACHED_WITH_SASL_SUPPORT)
{
if (server->fd != INVALID_SOCKET and server->root->sasl.callbacks)
}
}
}
+#endif
break;
case MEMCACHED_CONNECTION_UNIX_SOCKET:
key_buffer.resize(padding +1);
memset(&key_buffer[0], 'x', padding);
+#ifdef HAVE_UUID_UUID_H
if (HAVE_UUID_UUID_H)
{
-#if defined(HAVE_UUID_UUID_H) && HAVE_UUID_UUID_H
uuid_t out;
uuid_generate(out);
uuid_unparse(out, &key_buffer[0]);
_keys[x]= strdup(&key_buffer[0]);
(_keys[x])[UUID_STRING_MAXLENGTH]= 'x';
-#endif
}
else // We just use a number and pad the string if UUID is not available
+#endif
{
char int_buffer[MEMCACHED_MAXIMUM_INTEGER_DISPLAY_LENGTH +1];
int key_length= snprintf(int_buffer, sizeof(int_buffer), "%u", uint32_t(x));
*/
static test_return_t sasl_auth_test(memcached_st *memc)
{
+#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT
if (LIBMEMCACHED_WITH_SASL_SUPPORT)
{
test_compare(MEMCACHED_SUCCESS, memcached_set(memc, "foo", 3, "bar", 3, (time_t)0, (uint32_t)0));
memcached_quit(memc);
return TEST_SUCCESS;
}
+#else
+ (void)memc;
+#endif
return TEST_SKIPPED;
}