]> err.no Git - yubikey-personalization/commitdiff
send ndef through to args function, fix definition for args function in header
authorKlas Lindfors <klas@yubico.com>
Wed, 25 Apr 2012 10:08:38 +0000 (12:08 +0200)
committerKlas Lindfors <klas@yubico.com>
Wed, 25 Apr 2012 10:18:43 +0000 (12:18 +0200)
tests/test_args_to_config.c
ykpers-args.c
ykpers-args.h
ykpersonalize.c

index db1c17ed044cfc68b648d5a6b391a28075d97e3f..1df817b68e77b3d86620c44bd8964268fcbb7ac5 100644 (file)
@@ -111,6 +111,7 @@ int _test_config (YKP_CONFIG *cfg, YK_STATUS *st, int argc, char **argv)
 
        /* Options */
        char *salt = NULL;
+       char *ndef = NULL;
 
        int rc;
 
@@ -126,7 +127,7 @@ int _test_config (YKP_CONFIG *cfg, YK_STATUS *st, int argc, char **argv)
                            &autocommit, salt,
                            st, &verbose,
                            access_code, &use_access_code,
-                           &aesviahash,
+                           &aesviahash, ndef,
                            &exit_code);
 
        return rc;
index 42a354a47cc9925e8cbc91ce25767b3a73314be9..249a24f2e6e262764a61bcb054ff67bb849b6f3e 100644 (file)
@@ -421,7 +421,7 @@ int args_to_config(int argc, char **argv, YKP_CONFIG *cfg,
                                *exit_code = 1;
                                return 0;
                          }
-                         ndef = optarg;
+                         ndef = strdup(optarg);
                          ndef_seen = true;
                          break;
                case 'o':
index d45caf6e97898b32245697e5702bebb44268eb6e..14d3965283692ce90ee33f5de41a6e51014d838d 100644 (file)
@@ -38,7 +38,7 @@ int args_to_config(int argc, char **argv, YKP_CONFIG *cfg,
                   bool *autocommit, char *salt,
                   YK_STATUS *st, bool *verbose,
                   unsigned char *access_code, bool *use_access_code,
-                  bool *aesviahash,
+                  bool *aesviahash, char *ndef,
                   int *exit_code);
 
 void report_yk_error();
index 2ba0a197f5f36e121df1c9bed8439e4738722232..a430864bebd51c64f5761df2b75d3c37cb26b465 100644 (file)
@@ -65,6 +65,7 @@ int main(int argc, char **argv)
 
        /* Options */
        char *salt = NULL;
+       char *ndef = NULL;
 
        bool error = false;
        int exit_code = 0;
@@ -124,7 +125,7 @@ int main(int argc, char **argv)
                             &autocommit, salt,
                             st, &verbose,
                             access_code, &use_access_code,
-                            &aesviahash,
+                            &aesviahash, ndef,
                             &exit_code)) {
                goto err;
        }