From e2f0857080f4b4d45daad72671fd41826d44fefc Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Fri, 9 Nov 2012 14:18:28 +0100 Subject: [PATCH] allow -n/-t to be used without slot, default to 1 then. --- ykpers-args.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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; -- 2.39.5