X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/cbae1d34f6f188921639a746dc308130bbf2aa04..fda32cb6013c65f765fa9b203bed23e07d35ba59:/redis.c?ds=sidebyside diff --git a/redis.c b/redis.c index f2fbbdd5..380924de 100644 --- a/redis.c +++ b/redis.c @@ -27,7 +27,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#define REDIS_VERSION "1.3.13" +#define REDIS_VERSION "2.1.0" #include "fmacros.h" #include "config.h" @@ -2927,8 +2927,8 @@ static robj *createStringObjectFromLongLong(long long value) { incrRefCount(shared.integers[value]); o = shared.integers[value]; } else { - o = createObject(REDIS_STRING, NULL); if (value >= LONG_MIN && value <= LONG_MAX) { + o = createObject(REDIS_STRING, NULL); o->encoding = REDIS_ENCODING_INT; o->ptr = (void*)((long)value); } else { @@ -5412,8 +5412,10 @@ static zskiplistNode *zslCreateNode(int level, double score, robj *obj) { zskiplistNode *zn = zmalloc(sizeof(*zn)); zn->forward = zmalloc(sizeof(zskiplistNode*) * level); - if (level > 0) + if (level > 1) zn->span = zmalloc(sizeof(unsigned int) * (level - 1)); + else + zn->span = NULL; zn->score = score; zn->obj = obj; return zn;