From 3c3c16561a5e0896109a26a1cb50555dae996868 Mon Sep 17 00:00:00 2001 From: antirez Date: Sat, 12 Apr 2014 23:52:36 +0200 Subject: [PATCH] Fix seqlen computation in hllSparseAdd(). --- src/hyperloglog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hyperloglog.c b/src/hyperloglog.c index 8e0cba7ae..119cbab1c 100644 --- a/src/hyperloglog.c +++ b/src/hyperloglog.c @@ -779,7 +779,7 @@ int hllSparseAdd(robj *o, unsigned char *ele, size_t elesize) { * * Note that we already allocated space on the sds string * calling sdsMakeRoomFor(). */ - int seqlen = seq-n; + int seqlen = n-seq; int oldlen = is_xzero ? 2 : 1; int deltalen = seqlen-oldlen;