aboutsummaryrefslogtreecommitdiffstats
path: root/src/actionparser.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/actionparser.c
parent2415d22c7a82396daf21dabe6191531cfa21e6a3 (diff)
downloadck-5a96d39542d356fc3d102d52390a55d8cb6758d3.tar.gz
ck-5a96d39542d356fc3d102d52390a55d8cb6758d3.tar.bz2
ck-5a96d39542d356fc3d102d52390a55d8cb6758d3.zip
Leave no string uninitialized.
Diffstat (limited to 'src/actionparser.c')
-rw-r--r--src/actionparser.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/actionparser.c b/src/actionparser.c
index 1648372..5c6abf7 100644
--- a/src/actionparser.c
+++ b/src/actionparser.c
@@ -209,7 +209,7 @@ void determine_action(UserOpt *opt) {
return;
}
- char actionName[STR_S];
+ char actionName[STR_S] = "";
opt->action = parser_get_action(token, actionName);
if (opt->action != CK_WRONG_ACTION) {
LOG("Action to perform: %s", actionName);
@@ -247,7 +247,7 @@ int get_config(UserOpt *opt) {
ERR("Config needs a value");
return -1;
}
- char dir[STR_L];
+ char dir[STR_L] = "";
realpath(token, dir);
if (!util_is_dir(dir)) {
ERR("%s is not a directory", token);
@@ -314,7 +314,7 @@ void verbose() {
}
void get_possible_action_strings(char *dest, CkAction ckAction) {
- char buf[STR_M];
+ char buf[STR_M] = "";
switch (ckAction) {
#define X(ACTION) \
case CKA_##ACTION: \
@@ -337,8 +337,8 @@ void get_possible_action_strings(char *dest, CkAction ckAction) {
}
void print_parser_error(UserOpt *opt) {
- char errStr[STR_L];
- char names[STR_M];
+ char errStr[STR_L] = "";
+ char names[STR_M] = "";
get_possible_action_strings(names, opt->action);
switch (opt->err) {
@@ -375,7 +375,7 @@ void print_parser_error(UserOpt *opt) {
}
void print_parser_help() {
- char names[STR_M];
+ char names[STR_M] = "";
ckhelp("ck - the config keeper");
ckhelp("Usage:");
get_possible_action_strings(names, CKA_INIT);