From ec922cd0075eee0628ee28857541900a496ea9e1 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Fri, 31 Dec 2010 14:40:39 +0100 Subject: [PATCH] Unsubscribe messages always have 3 elements --- async.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/async.c b/async.c index d89a2a063..8343df40c 100644 --- a/async.c +++ b/async.c @@ -330,8 +330,8 @@ static int __redisGetSubscribeCallback(redisAsyncContext *ac, redisReply *reply, /* If this was the last unsubscribe message, revert to * non-subscribe mode. */ - assert(reply->element[2+pvariant]->type == REDIS_REPLY_INTEGER); - if (reply->element[2+pvariant]->integer == 0) + assert(reply->element[2]->type == REDIS_REPLY_INTEGER); + if (reply->element[2]->integer == 0) c->flags &= ~REDIS_SUBSCRIBED; } }