active defrag improvements

This commit is contained in:
oranagra
2017-01-02 09:42:32 +02:00
parent 7aa9e6d2ae
commit 5ab6a54cc6
4 changed files with 63 additions and 44 deletions

View File

@ -457,8 +457,9 @@ void debugCommand(client *c) {
if (valsize==0)
val = createStringObject(buf,strlen(buf));
else {
int buflen = strlen(buf);
val = createStringObject(NULL,valsize);
memset(val->ptr, 0, valsize);
memcpy(val->ptr, buf, valsize<=buflen? valsize: buflen);
}
dbAdd(c->db,key,val);
signalModifiedKey(c->db,key);