From: Klas Lindfors Date: Wed, 25 Apr 2012 10:08:38 +0000 (+0200) Subject: send ndef through to args function, fix definition for args function in header X-Git-Tag: v1.7.0~1^2~34 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e365c7aca1cc80d15915032cc0636420d3ad4ad2;p=yubikey-personalization send ndef through to args function, fix definition for args function in header --- diff --git a/tests/test_args_to_config.c b/tests/test_args_to_config.c index db1c17e..1df817b 100644 --- a/tests/test_args_to_config.c +++ b/tests/test_args_to_config.c @@ -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; diff --git a/ykpers-args.c b/ykpers-args.c index 42a354a..249a24f 100644 --- a/ykpers-args.c +++ b/ykpers-args.c @@ -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': diff --git a/ykpers-args.h b/ykpers-args.h index d45caf6..14d3965 100644 --- a/ykpers-args.h +++ b/ykpers-args.h @@ -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(); diff --git a/ykpersonalize.c b/ykpersonalize.c index 2ba0a19..a430864 100644 --- a/ykpersonalize.c +++ b/ykpersonalize.c @@ -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; }