diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2018-10-26 16:00:29 +0300 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2018-10-26 16:02:07 +0300 |
commit | 41ae1a0f0d86d2fc19f333ee23889c11beb0a4dd (patch) | |
tree | b29207e44aa8dcc10ef2deb51ac1514fb934c420 /src/actionparser.c | |
parent | a6b2b4b2a4095d2f95419df986378e54432c2d71 (diff) | |
download | ck-41ae1a0f0d86d2fc19f333ee23889c11beb0a4dd.tar.gz ck-41ae1a0f0d86d2fc19f333ee23889c11beb0a4dd.tar.bz2 ck-41ae1a0f0d86d2fc19f333ee23889c11beb0a4dd.zip |
Confort to pedantic std-c99 and update readme
Diffstat (limited to 'src/actionparser.c')
-rw-r--r-- | src/actionparser.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/actionparser.c b/src/actionparser.c index 009ee2a..9954fbc 100644 --- a/src/actionparser.c +++ b/src/actionparser.c @@ -34,10 +34,10 @@ static int optNum; /* holds the list of the opts * as given by the user */ -static char **opts; +static const char **opts; /* points to the current token */ -static char *token; +static const char *token; /* the position to be read */ static int pos = 0; @@ -205,7 +205,7 @@ void determine_action(UserOpt *opt) { UserOpt make_empty_user_opt() { UserOpt opt; - opt.action = -1; + opt.action = CK_WRONG_ACTION; opt.err = PERR_NOERR; opt.confDir = NULL; opt.args = list_make_new(); @@ -252,7 +252,7 @@ int get_config(UserOpt *opt) { pos = pos - 1; token = opts[pos]; } - char * defaultConf = ".ck"; + char defaultConf[STR_S] = ".ck"; char * home = getenv("HOME"); opt->confDir = malloc(strlen(defaultConf) + 1 /* '/' */ + strlen(home) + 1); str_join_dirname_with_basename(opt->confDir, home, defaultConf); @@ -378,7 +378,7 @@ void print_parser_help() { report_help(); } -int parse_action(int argc, char* argv[], UserOpt *opt) { +int parse_action(int argc, const char **argv, UserOpt *opt) { /* make empty user opt */ *opt = make_empty_user_opt(); opts = argv; |