From 41ae1a0f0d86d2fc19f333ee23889c11beb0a4dd Mon Sep 17 00:00:00 2001 From: gramanas Date: Fri, 26 Oct 2018 16:00:29 +0300 Subject: Confort to pedantic std-c99 and update readme --- src/actionparser.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/actionparser.c') 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; -- cgit v1.2.3