Minor bug discovered at hackathon.
authorBrian Aker <brian@tangent.org>
Sun, 16 Dec 2007 12:54:33 +0000 (04:54 -0800)
committerBrian Aker <brian@tangent.org>
Sun, 16 Dec 2007 12:54:33 +0000 (04:54 -0800)
configure.ac
include/memcached.h
lib/memcached_hosts.c

index a1bc2afe89e2355c7bff3a8c57a5406020f7bea8..3e3acbc40b8c6e6d49c418df72f2ddadea1102dd 100644 (file)
@@ -68,5 +68,6 @@ else
 fi
 
 AC_C_CONST
+AC_HEADER_TIME
 AC_TYPE_SIZE_T
 AC_OUTPUT(Makefile src/Makefile tests/Makefile docs/Makefile lib/Makefile include/Makefile support/Makefile support/libmemcached.pc support/libmemcached.spec)
index 315c284ba3742452199c3660e0f3de8c6c66af73..182d69928973d3a82b225fb1b8651bdc89b8caf3 100644 (file)
@@ -11,7 +11,7 @@
 #define __MEMCACHED_H__
 
 #include <stdlib.h>
-#include <stdint.h>
+#include <inttypes.h>
 #include <sys/types.h>
 #include <netinet/in.h>
 
@@ -181,6 +181,7 @@ struct memcached_result_st {
   memcached_string_st value;
   uint32_t flags;
   uint64_t cas;
+  /* Add result callback function */
 };
 
 struct memcached_st {
index 402018b4ae90cb58492776a5afed153c9c908b71..5661e541180fdcb64a0e1b0d8cd433f59b322bfc 100644 (file)
@@ -38,7 +38,7 @@ static void host_reset(memcached_server_st *host, char *hostname, unsigned int p
                        memcached_connection type)
 {
   memset(host,  0, sizeof(memcached_server_st));
-  memcpy(host->hostname, hostname, strlen(hostname));
+  strncpy(host->hostname, hostname, MEMCACHED_MAX_HOST_LENGTH - 1);
   host->port= port;
   host->fd= -1;
   host->type= type;