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. --- src/pacman/conf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/pacman/conf.c') diff --git a/src/pacman/conf.c b/src/pacman/conf.c index 3b475151..fe6d6971 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -1117,8 +1117,7 @@ int setdefaults(config_t *c) int parseconfigfile(const char *file) { - struct section_t section; - memset(§ion, 0, sizeof(struct section_t)); + struct section_t section = {0}; pm_printf(ALPM_LOG_DEBUG, "config: attempting to read file %s\n", file); return parse_ini(file, _parse_directive, §ion); } -- cgit v1.2.3-24-g4f1b