From ab1c128609c988b60746c7843594c58463bdb8f1 Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Tue, 18 Sep 2012 08:37:52 +0200 Subject: [PATCH] move up declarations before code to avoid warnings --- ykpers-args.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ykpers-args.c b/ykpers-args.c index 48ec717..9bd4b52 100644 --- a/ykpers-args.c +++ b/ykpers-args.c @@ -270,10 +270,11 @@ int args_to_config(int argc, char **argv, YKP_CONFIG *cfg, YK_KEY *yk, bool swap_seen = false; bool update_seen = false; bool ndef_seen = false; + struct config_st *ycfg; ykp_configure_version(cfg, st); - struct config_st *ycfg = (struct config_st *) ykp_core_config(cfg); + ycfg = (struct config_st *) ykp_core_config(cfg); while((c = getopt(argc, argv, optstring)) != -1) { if (c == 'o') { @@ -329,6 +330,7 @@ int args_to_config(int argc, char **argv, YKP_CONFIG *cfg, YK_KEY *yk, break; case '1': case '2': { + int command; if (slot_chosen) { fprintf(stderr, "You may only choose slot (-1 / -2) once.\n"); *exit_code = 1; @@ -349,7 +351,6 @@ int args_to_config(int argc, char **argv, YKP_CONFIG *cfg, YK_KEY *yk, *exit_code = 1; return 0; } - int command; if (update_seen) { memcpy(ycfg, &default_update, sizeof(default_update)); if(c == '1') { -- 2.39.5