From: Klas Lindfors Date: Fri, 9 Nov 2012 13:18:28 +0000 (+0100) Subject: allow -n/-t to be used without slot, default to 1 then. X-Git-Tag: v1.10.0~34 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2f0857080f4b4d45daad72671fd41826d44fefc;p=yubikey-personalization allow -n/-t to be used without slot, default to 1 then. --- diff --git a/ykpers-args.c b/ykpers-args.c index 05884e9..a8b4c4a 100644 --- a/ykpers-args.c +++ b/ykpers-args.c @@ -410,11 +410,6 @@ int args_to_config(int argc, char **argv, YKP_CONFIG *cfg, YK_KEY *yk, if(!*ndef_type) { *ndef_type = 'U'; } - if (!slot_chosen) { - fprintf(stderr, "A slot (-1/-2) must be chosen before ndef (-n/-t) argument.\n"); - *exit_code = 1; - return 0; - } if (swap_seen || update_seen || option_seen || *zap) { fprintf(stderr, "Ndef (-n/-t) can only be used with a slot (-1/-2).\n"); *exit_code = 1; @@ -425,7 +420,7 @@ int args_to_config(int argc, char **argv, YKP_CONFIG *cfg, YK_KEY *yk, } else if(ykp_command(cfg) == SLOT_CONFIG2) { command = SLOT_NDEF2; } else { - return 0; + command = SLOT_NDEF; } if (!ykp_configure_command(cfg, command)) { return 0;