From 9883015be2b2010ad541fd02b6856bfdb28fb35d Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Tue, 24 Dec 2019 10:28:11 -0500 Subject: Use c99 struct initialization to avoid memset calls This is guaranteed less error prone than calling memset and hoping the human gets the argument order correct. --- lib/libalpm/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libalpm/util.c') diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index a4d62c7c..d12a4403 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -1191,7 +1191,7 @@ cleanup: { int ret = b->ret; FREE(b->line); - memset(b, 0, sizeof(struct archive_read_buffer)); + *b = (struct archive_read_buffer){0}; return ret; } } -- cgit v1.2.3-54-g00ecf