From 2ef9c2e5f769bb5233f740250b0c7a0159e56fae Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 16 Dec 2010 21:50:34 +0100 Subject: [PATCH] Redefine REDIS_REPLY_ERROR to be non-zero When no reply object functions are defined, the reply type integer is returned from redisGetReply(). This sets the *reply argument to the consumed reply, where 0 means that it was not possible to consume a full reply. With REDIS_REPLY_ERROR having the same value, there is no way to tell the difference between an error reply and not consuming a reply. --- hiredis.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hiredis.h b/hiredis.h index 7fd7770..b202cb0 100644 --- a/hiredis.h +++ b/hiredis.h @@ -62,12 +62,12 @@ * should be terminated once all replies have been read. */ #define REDIS_DISCONNECTING 0x4 -#define REDIS_REPLY_ERROR 0 #define REDIS_REPLY_STRING 1 #define REDIS_REPLY_ARRAY 2 #define REDIS_REPLY_INTEGER 3 #define REDIS_REPLY_NIL 4 #define REDIS_REPLY_STATUS 5 +#define REDIS_REPLY_ERROR 6 #ifdef __cplusplus extern "C" {