Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/be_local.c
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2019-12-24 10:28:11 -0500
committerAllan McRae <allan@archlinux.org>2020-01-07 11:40:32 +1000
commit9883015be2b2010ad541fd02b6856bfdb28fb35d (patch)
treecea21e7bc4eab89a47356f60c4b924ae3043bb42 /lib/libalpm/be_local.c
parentffb69c700abd6eb3b86e79e09b135029ff9104b4 (diff)
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.
Diffstat (limited to 'lib/libalpm/be_local.c')
-rw-r--r--lib/libalpm/be_local.c5
1 files changed, 1 insertions, 4 deletions
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");