From: Richard Levitte Date: Fri, 18 Sep 2009 12:04:23 +0000 (+0000) Subject: Better to handle -h after the core is initialised X-Git-Tag: yubikey-personalisation_1.3.5-1~4^2~50 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=025f3949290a4b6c233bf2a83d5123820a265fb4;p=yubikey-personalization Better to handle -h after the core is initialised --- diff --git a/ykpersonalize.c b/ykpersonalize.c index 46f9944..effd8d0 100644 --- a/ykpersonalize.c +++ b/ykpersonalize.c @@ -183,11 +183,6 @@ int main(int argc, char **argv) ykp_errno = 0; yk_errno = 0; - if (argc == 2 && strcmp (argv[1], "-h") == 0) { - fputs(usage, stderr); - goto err; - } - /* Assume the worst */ error = true; @@ -196,6 +191,11 @@ int main(int argc, char **argv) goto err; } + if (argc == 2 && strcmp (argv[1], "-h") == 0) { + fputs(usage, stderr); + goto err; + } + if (!(yk = yk_open_first_key())) { exit_code = 1; goto err;