aboutsummaryrefslogtreecommitdiffstats
path: root/src/confparser.c
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2018-11-13 15:12:31 +0200
committergramanas <anastasis.gramm2@gmail.com>2018-11-13 15:12:31 +0200
commit5a96d39542d356fc3d102d52390a55d8cb6758d3 (patch)
tree0f9e6844e880759e5b5b20b6af683a0822de410c /src/confparser.c
parent2415d22c7a82396daf21dabe6191531cfa21e6a3 (diff)
downloadck-5a96d39542d356fc3d102d52390a55d8cb6758d3.tar.gz
ck-5a96d39542d356fc3d102d52390a55d8cb6758d3.tar.bz2
ck-5a96d39542d356fc3d102d52390a55d8cb6758d3.zip
Leave no string uninitialized.
Diffstat (limited to 'src/confparser.c')
-rw-r--r--src/confparser.c10
1 files changed, 5 insertions, 5 deletions
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) {