]> err.no Git - yubikey-personalization/commitdiff
move up declarations before code to avoid warnings
authorKlas Lindfors <klas@yubico.com>
Tue, 18 Sep 2012 06:37:52 +0000 (08:37 +0200)
committerKlas Lindfors <klas@yubico.com>
Tue, 18 Sep 2012 06:37:52 +0000 (08:37 +0200)
ykpers-args.c

index 48ec717c1aeee01bb95fee704508d23644ba3e68..9bd4b52b696c430bbe5539c8cdf6f35c74b01591 100644 (file)
@@ -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') {