Skip to content

Commit 50a3070

Browse files
committed
修复 sds.c 中的一个小 bug
1 parent d72bef0 commit 50a3070

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ void sdsIncrLen(sds s, int incr) {
295295
/* Grow the sds to have the specified length. Bytes that were not part of
296296
* the original length of the sds will be set to zero. */
297297
/*
298-
* 将 sds 的 buf 扩展至给定长度,无内容部分用 0 来填充
298+
* 将 sds 的 buf 扩展至给定长度,无内容部分用 \0 来填充
299299
*
300300
* T = O(N)
301301
*/
@@ -313,7 +313,7 @@ sds sdsgrowzero(sds s, size_t len) {
313313
if (s == NULL) return NULL;
314314

315315
/* Make sure added region doesn't contain garbage */
316-
// 使用 0 来填充空位,确保空位中不包含垃圾数据
316+
// 使用 \0 来填充空位,确保空位中不包含垃圾数据
317317
sh = (void*)(s-(sizeof(struct sdshdr)));
318318
memset(s+curlen,0,(len-curlen+1)); /* also set trailing \0 byte */
319319

0 commit comments

Comments
 (0)