diff options
Diffstat (limited to 'src/widget-otp.c')
| -rw-r--r-- | src/widget-otp.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/widget-otp.c b/src/widget-otp.c index ae67a86..d4c06fc 100644 --- a/src/widget-otp.c +++ b/src/widget-otp.c | |||
| @@ -132,14 +132,21 @@ otputil_widget_otp( | |||
| 132 | fprintf(stderr, "%s: otputil_set_param(OTP_SEQ): %s\n", cnf->prog_name, otputil_err2string(rc)); | 132 | fprintf(stderr, "%s: otputil_set_param(OTP_SEQ): %s\n", cnf->prog_name, otputil_err2string(rc)); |
| 133 | return(1); | 133 | return(1); |
| 134 | }; | 134 | }; |
| 135 | optind++; | ||
| 135 | }; | 136 | }; |
| 136 | if (cnf->argc > (optind+1)) | 137 | if (cnf->argc > optind) |
| 137 | { | 138 | { |
| 138 | if ((rc = otputil_set_param(NULL, OTPUTIL_OPT_OTP_SEED, cnf->argv[optind+1])) != OTPUTIL_SUCCESS) | 139 | if ((rc = otputil_set_param(NULL, OTPUTIL_OPT_OTP_SEED, cnf->argv[optind])) != OTPUTIL_SUCCESS) |
| 139 | { | 140 | { |
| 140 | fprintf(stderr, "%s: otputil_set_param(OTP_SEED): %s\n", cnf->prog_name, otputil_err2string(rc)); | 141 | fprintf(stderr, "%s: otputil_set_param(OTP_SEED): %s\n", cnf->prog_name, otputil_err2string(rc)); |
| 141 | return(1); | 142 | return(1); |
| 142 | }; | 143 | }; |
| 144 | optind++; | ||
| 145 | }; | ||
| 146 | if (cnf->argc > optind) | ||
| 147 | { | ||
| 148 | cnf->otp_pass = cnf->argv[optind]; | ||
| 149 | optind++; | ||
| 143 | }; | 150 | }; |
| 144 | 151 | ||
| 145 | // verify password and seed were provided | 152 | // verify password and seed were provided |
