if (obj->encoding == REDIS_ENCODING_INT) {
return rdbSaveLongLongAsStringObject(rdb,(long)obj->ptr);
} else {
- redisAssert(obj->encoding == REDIS_ENCODING_RAW);
+ redisAssertWithInfo(NULL,obj,obj->encoding == REDIS_ENCODING_RAW);
return rdbSaveRawString(rdb,obj->ptr,sdslen(obj->ptr));
}
}
* we could switch to a faster solution. */
off_t rdbSavedObjectLen(robj *o) {
int len = rdbSaveObject(NULL,o);
- redisAssert(len != -1);
+ redisAssertWithInfo(NULL,o,len != -1);
return len;
}
return REDIS_ERR;
}
- rdb = rioInitWithFile(fp);
+ rioInitWithFile(&rdb,fp);
if (rdbWriteRaw(&rdb,"REDIS0002",9) == -1) goto werr;
for (j = 0; j < server.dbnum; j++) {
fp = fopen(filename,"r");
if (!fp) return REDIS_ERR;
- rdb = rioInitWithFile(fp);
+ rioInitWithFile(&rdb,fp);
if (rioRead(&rdb,buf,9) == 0) goto eoferr;
buf[9] = '\0';
if (memcmp(buf,"REDIS",5) != 0) {