X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Farray.c;h=2412369e2a4199d81815d5d04cad496b4602ddcd;hb=2df9084da8c73d8813f8740e88cd70fe63dd742c;hp=657bcdad96840c3909fe5ccce3c93c41e8637250;hpb=385cc099521ab79b8ecb289cd25c46d7cf3caa5c;p=m6w6%2Flibmemcached diff --git a/libmemcached/array.c b/libmemcached/array.c index 657bcdad..2412369e 100644 --- a/libmemcached/array.c +++ b/libmemcached/array.c @@ -62,11 +62,20 @@ memcached_array_st *memcached_strcpy(memcached_st *memc, const char *str, size_t array->root= memc; array->size= str_length -1; // We don't count the NULL ending memcpy(array->c_str, str, str_length); - array->c_str[str_length +1]= 0; + array->c_str[str_length]= 0; return array; } +memcached_string_t memcached_array_to_string(memcached_array_st *array) +{ + memcached_string_t tmp; + tmp.c_str= array->c_str; + tmp.size= array->size; + + return tmp; +} + void memcached_array_free(memcached_array_st *array) { if (! array)