mirror of
https://github.com/fluencelabs/redis
synced 2025-06-16 18:51:20 +00:00
Change function name to match what it does
This commit is contained in:
@ -117,8 +117,8 @@ static sds sdsMakeRoomFor(sds s, size_t addlen) {
|
||||
}
|
||||
|
||||
/* Grow the sds to have the specified length. Bytes that were not part of
|
||||
* the original length of the sds will be set to NULL. */
|
||||
sds sdsgrowsafe(sds s, size_t len) {
|
||||
* the original length of the sds will be set to zero. */
|
||||
sds sdsgrowzero(sds s, size_t len) {
|
||||
struct sdshdr *sh = (void*)(s-(sizeof(struct sdshdr)));
|
||||
size_t totlen, curlen = sh->len;
|
||||
|
||||
@ -128,7 +128,7 @@ sds sdsgrowsafe(sds s, size_t len) {
|
||||
|
||||
/* Make sure added region doesn't contain garbage */
|
||||
sh = (void*)(s-(sizeof(struct sdshdr)));
|
||||
memset(s+curlen,0,(len-curlen+1)); /* also set trailing NULL byte */
|
||||
memset(s+curlen,0,(len-curlen+1)); /* also set trailing \0 byte */
|
||||
totlen = sh->len+sh->free;
|
||||
sh->len = len;
|
||||
sh->free = totlen-sh->len;
|
||||
|
Reference in New Issue
Block a user