summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2019-12-24 16:28:11 +0100
committerAllan McRae <allan@archlinux.org>2020-01-07 02:40:32 +0100
commit9883015be2b2010ad541fd02b6856bfdb28fb35d (patch)
treecea21e7bc4eab89a47356f60c4b924ae3043bb42 /src
parentffb69c700abd6eb3b86e79e09b135029ff9104b4 (diff)
downloadpacman-9883015be2b2010ad541fd02b6856bfdb28fb35d.tar.gz
pacman-9883015be2b2010ad541fd02b6856bfdb28fb35d.tar.xz
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 'src')
-rw-r--r--src/pacman/conf.c3
1 files changed, 1 insertions, 2 deletions
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(&section, 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, &section);
}