summaryrefslogtreecommitdiff
path: root/src/sds.c
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2010-12-10 12:16:16 +0100
committerPieter Noordhuis <pcnoordhuis@gmail.com>2010-12-10 12:16:16 +0100
commitcc209063904ed5d86a34b2297ceac00854ff6c01 (patch)
tree5d8fe7e082134efffb5bd028784c38c011d76a01 /src/sds.c
parent586500c0ef32f480dba9bc10aedb3f72bd525118 (diff)
downloadredis-cc209063904ed5d86a34b2297ceac00854ff6c01.tar.gz
Change function name to match what it does
Diffstat (limited to 'src/sds.c')
-rw-r--r--src/sds.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sds.c b/src/sds.c
index de6201910..da049f6ce 100644
--- a/src/sds.c
+++ b/src/sds.c
@@ -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;