From 6dd5a36699b4d46296cff6526f203212ab7405b6 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 4 May 2016 14:13:36 +0200 Subject: do not allow to give second factor twice --- bin/ykfde.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bin/ykfde.c b/bin/ykfde.c index 44ead9a..402ecb7 100644 --- a/bin/ykfde.c +++ b/bin/ykfde.c @@ -97,10 +97,22 @@ int main(int argc, char **argv) { help++; break; case 'n': + if (new_2nd_factor != NULL) { + fprintf(stderr, "We already have a new second factor. Did you specify it twice?\n"); + rc = EXIT_FAILURE; + goto out10; + } + new_2nd_factor = strdup(optarg); memset(optarg, '*', strlen(optarg)); break; case 's': + if (payload != NULL) { + fprintf(stderr, "We already have a second factor. Did you specify it twice?\n"); + rc = EXIT_FAILURE; + goto out10; + } + payload = strdup(optarg); memset(optarg, '*', strlen(optarg)); break; -- cgit v1.2.3-70-g09d2