aboutsummaryrefslogtreecommitdiffstats
path: root/src/ck.c
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2018-04-16 14:34:30 +0300
committergramanas <anastasis.gramm2@gmail.com>2018-04-16 14:43:50 +0300
commit94bc38df829c4816e629c7dcaed31b1e7c75bc4b (patch)
treec02d2de0f44462c82e24591127caf66b05d8710d /src/ck.c
parentafc0f4906ed9891962d1797581afeb5c61e2e3af (diff)
downloadck-94bc38df829c4816e629c7dcaed31b1e7c75bc4b.tar.gz
ck-94bc38df829c4816e629c7dcaed31b1e7c75bc4b.tar.bz2
ck-94bc38df829c4816e629c7dcaed31b1e7c75bc4b.zip
Add asan option to cmake
finish init without any asan warnings
Diffstat (limited to 'src/ck.c')
-rw-r--r--src/ck.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ck.c b/src/ck.c
index 2833176..61797b4 100644
--- a/src/ck.c
+++ b/src/ck.c
@@ -11,21 +11,24 @@ int main(int argc, char *argv[]) {
UserOpt opt;
switch(parseAction(argc, argv, &opt)) {
case OPR_HELP:
+ free_user_opt(&opt);
printParserHelp();
+ return 0;
case OPR_ERR:
printParserError(&opt);
+ free_user_opt(&opt);
+ return 1;
case OPR_OK:
break;
}
- printf("%s\n", opt.confDir);
Conf conf;
if (opt.action != CKA_INIT) {
- if (!db_exists()) {
- printf("ck is not initialized.\nRun ck init first.\n");
+ if (!db_exists(&opt)) {
+ printf("ck is not initialized in %s.\nRun ck init first.\n", opt.confDir);
return 1;
}
- if (!config_file_parse(&conf)) {
+ if (!config_file_parse(&conf, &opt)) {
return 1;
}
}
@@ -48,5 +51,6 @@ int main(int argc, char *argv[]) {
CK_ACTIONS
#undef X
}
+ free_user_opt(&opt);
return 0;
}