From 5a96d39542d356fc3d102d52390a55d8cb6758d3 Mon Sep 17 00:00:00 2001 From: gramanas Date: Tue, 13 Nov 2018 15:12:31 +0200 Subject: Leave no string uninitialized. --- src/confparser.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/confparser.c') diff --git a/src/confparser.c b/src/confparser.c index 8547867..019cf14 100644 --- a/src/confparser.c +++ b/src/confparser.c @@ -24,7 +24,7 @@ void initialize_conf(Conf *c) { } int read_next_line(char *line, FILE *f) { - char nextLine[STR_L]; + char nextLine[STR_L] = ""; if (fgets(nextLine, STR_L, f) == NULL) { return -1; } @@ -46,7 +46,7 @@ ConfVar match_variables(char *line, char matched[]) { } void make_config_name(char * ret, const char *confPath) { - char tmp[STR_L]; + char tmp[STR_L] = ""; strcpy(tmp, confPath); strcat(tmp, CONFIG_NAME); @@ -56,9 +56,9 @@ void make_config_name(char * ret, const char *confPath) { int config_file_parse(Conf *conf, UserOpt *opt) { LOG("Using '%s' for ck configuration directory", opt->confDir); FILE *confPtr; - char confName[STR_L]; - char line[STR_L]; - char matched[STR_L]; + char confName[STR_L] = ""; + char line[STR_L] = ""; + char matched[STR_L] = ""; make_config_name(confName, opt->confDir); if ((confPtr = fopen(confName, "r")) == NULL) { -- cgit v1.2.3