Updates for CORK.
[m6w6/libmemcached] / libmemcached / key.c
1 #include "common.h"
2
3 memcached_return_t memcached_key_test(const char * const *keys,
4 const size_t *key_length,
5 size_t number_of_keys)
6 {
7 uint32_t x;
8 memcached_return_t rc;
9
10 for (x= 0; x < number_of_keys; x++)
11 {
12 size_t y;
13
14 rc= memcached_validate_key_length(*(key_length + x), false);
15 if (rc != MEMCACHED_SUCCESS)
16 return rc;
17
18 for (y= 0; y < *(key_length + x); y++)
19 {
20 if ((isgraph(keys[x][y])) == 0)
21 return MEMCACHED_BAD_KEY_PROVIDED;
22 }
23 }
24
25 return MEMCACHED_SUCCESS;
26 }
27