aboutsummaryrefslogtreecommitdiffstats
path: root/src/actionparser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/actionparser.c')
-rw-r--r--src/actionparser.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/actionparser.c b/src/actionparser.c
index 207a089..0dca98c 100644
--- a/src/actionparser.c
+++ b/src/actionparser.c
@@ -203,11 +203,10 @@ void get_config(UserOpt *opt) {
return;
}
}
- char * defaultConf = "/.ck";
+ char * defaultConf = ".ck";
char * home = getenv("HOME");
- opt->confDir = malloc(strlen(defaultConf)+strlen(home)+1);
- strcpy(opt->confDir, home);
- strcat(opt->confDir, defaultConf);
+ opt->confDir = malloc(strlen(defaultConf) + 1 /* '/' */ + strlen(home)+1);
+ str_join_dirname_with_basename(opt->confDir, home, defaultConf);
// rewind
pos = pos - 1;