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/be_local.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib/libalpm/be_local.c') diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index b89acf05..78e32a24 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -694,7 +694,7 @@ char *_alpm_local_db_pkgpath(alpm_db_t *db, alpm_pkg_t *info, static int local_db_read(alpm_pkg_t *info, int inforeq) { FILE *fp = NULL; - char line[1024]; + char line[1024] = {0}; alpm_db_t *db = info->origin_data.db; /* bitmask logic here: @@ -717,9 +717,6 @@ static int local_db_read(alpm_pkg_t *info, int inforeq) "loading package data for %s : level=0x%x\n", info->name, inforeq); - /* clear out 'line', to be certain - and to make valgrind happy */ - memset(line, 0, sizeof(line)); - /* DESC */ if(inforeq & INFRQ_DESC && !(info->infolevel & INFRQ_DESC)) { char *path = _alpm_local_db_pkgpath(db, info, "desc"); -- cgit v1.2.3-54-g00ecf