projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Added missing constant.
[m6w6/libmemcached]
/
clients
/
memerror.c
diff --git
a/clients/memerror.c
b/clients/memerror.c
index fbad55ba2f00245d2182bcbda522ee20c3428647..286ef0e142b6630193b6a96b88032268d8bc6ea9 100644
(file)
--- a/
clients/memerror.c
+++ b/
clients/memerror.c
@@
-1,3
+1,14
@@
+/* LibMemcached
+ * Copyright (C) 2006-2009 Brian Aker
+ * All rights reserved.
+ *
+ * Use and distribution licensed under the BSD license. See
+ * the COPYING file in the parent directory for full text.
+ *
+ * Summary:
+ *
+ */
+
#include "libmemcached/common.h"
#include <stdio.h>
#include <inttypes.h>
#include "libmemcached/common.h"
#include <stdio.h>
#include <inttypes.h>
@@
-20,12
+31,23
@@
static int opt_verbose= 0;
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
+ unsigned long value;
options_parse(argc, argv);
if (argc != 2)
return 1;
options_parse(argc, argv);
if (argc != 2)
return 1;
- printf("%s\n", memcached_strerror(NULL, atoi(argv[1])));
+ value= strtoul(argv[1], (char **) NULL, 10);
+
+ if (value < MEMCACHED_MAXIMUM_RETURN)
+ {
+ printf("%s\n", memcached_strerror(NULL, (memcached_return_t)value));
+ }
+ else
+ {
+ fprintf(stderr, "Unknown Error Code\n");
+ return 1;
+ }
return 0;
}
return 0;
}