problem with libmemcache

Andy Powell andy at
Sat Apr 2 11:29:18 PST 2005

gavin hurley wrote:
> Anyway, here's the program. My environment is Linux. Basically, I'm 
> looking for someone to either show that I'm an idiot or bring awareness 
> to a bug in libmemcache. Many thanks.

You aren't terminating your strings with \0 (NULL) which is pretty bad 
practice imho... libmemcahe is not passing you NULL terminated strings, 
it's passing you the length of the string and the string itself eg:

   req = mc_req_new();
   result = mc_req_add(req, skey, strlen(skey));
   mc_get(mc, req);

result->size contains the size (length of the string)...



More information about the memcached mailing list