summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2010-10-06 21:10:09 +0200
committerPieter Noordhuis <pcnoordhuis@gmail.com>2010-10-06 21:10:09 +0200
commit1a5f111d5208ce3ea5d0d64fa167cec6781abd4f (patch)
tree28b898210aac994a03b44041f69f47c0dd1bbb14
parent97920b443e58aa9c15f9836841164c7123194859 (diff)
c->error is no longer a redisReply object, but rather a plain C-string
-rw-r--r--example.c2
-rw-r--r--test.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/example.c b/example.c
index 7878806..7c3f353 100644
--- a/example.c
+++ b/example.c
@@ -11,7 +11,7 @@ int main(void) {
c = redisConnect((char*)"127.0.0.1", 6379, NULL);
if (c->error != NULL) {
- printf("Connection error: %s", ((redisReply*)c->error)->reply);
+ printf("Connection error: %s", c->error);
exit(1);
}
diff --git a/test.c b/test.c
index ab73e70..cca1587 100644
--- a/test.c
+++ b/test.c
@@ -16,10 +16,11 @@ static long long usec(void) {
return (((long long)tv.tv_sec)*1000000)+tv.tv_usec;
}
-static void __connect(redisContext **c) {
- *c = redisConnect((char*)"127.0.0.1", 6379, NULL);
- if ((*c)->error != NULL) {
- printf("Connection error: %s", ((redisReply*)(*c)->error)->reply);
+static void __connect(redisContext **target) {
+ redisContext *c;
+ c = *target = redisConnect((char*)"127.0.0.1", 6379, NULL);
+ if (c->error != NULL) {
+ printf("Connection error: %s", c->error);
exit(1);
}
}