buf_sub: don't memset destination

Thu, 29 Oct 2020 17:28:23 +0100

author
David Demelier <markand@malikania.fr>
date
Thu, 29 Oct 2020 17:28:23 +0100
changeset 1
cf8cb4a0729e
parent 0
b1991ee4451d
child 2
3665a56a00aa

buf_sub: don't memset destination

buf-sub.c file | annotate | diff | comparison | revisions
--- a/buf-sub.c	Thu Oct 29 17:24:30 2020 +0100
+++ b/buf-sub.c	Thu Oct 29 17:28:23 2020 +0100
@@ -29,8 +29,6 @@
 	assert(src);
 	assert(pos <= src->length);
 
-	memset(b, 0, sizeof (*b));
-
 	if (count >= src->length)
 		count = src->length - pos;
 	if (!(b->data = BUF_MALLOC(count + 1)))

mercurial