From 816aa2e3dfe7d1a44edd66745bee33faa499e709 Mon Sep 17 00:00:00 2001 From: Date: Sun, 17 Feb 2008 21:26:31 +0530 Subject: [PATCH 1/1] Minor cleanups (missing file added). --- lib/common.h | 1 - lib/memcached_key.c | 20 ++++++++++++++++++++ lib/memcached_parse.c | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 lib/memcached_key.c diff --git a/lib/common.h b/lib/common.h index 9e4cb5e1..b09d5433 100644 --- a/lib/common.h +++ b/lib/common.h @@ -21,7 +21,6 @@ #include #include #include -#include #if TIME_WITH_SYS_TIME # include diff --git a/lib/memcached_key.c b/lib/memcached_key.c new file mode 100644 index 00000000..ef1fe15f --- /dev/null +++ b/lib/memcached_key.c @@ -0,0 +1,20 @@ +#include "common.h" + +memcached_return memcachd_key_test(char **keys, size_t *key_length, + unsigned int number_of_keys) +{ + int x; + + for (x= 0; x < number_of_keys; x++) + { + int y; + for (y= 0; y < key_length[x]; y++) + { + if ((isgraph(keys[x][y])) == 0) + return MEMCACHED_BAD_KEY_PROVIDED; + } + } + + return MEMCACHED_SUCCESS; +} + diff --git a/lib/memcached_parse.c b/lib/memcached_parse.c index 52154215..366e77b5 100644 --- a/lib/memcached_parse.c +++ b/lib/memcached_parse.c @@ -6,7 +6,7 @@ */ #include -#include +#include "common.h" memcached_server_st *memcached_servers_parse(char *server_strings) { -- 2.30.2