aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2016-05-04 14:13:36 +0200
committerGravatar Christian Hesse <mail@eworm.de>2016-05-04 14:13:36 +0200
commit6dd5a36699b4d46296cff6526f203212ab7405b6 (patch)
tree7a2c79dd7fcaeee8459044c6e872d38e908f08f3
parentb133e70d60a7791c350ba0cf9fb4604bdbd18c9a (diff)
downloadmkinitcpio-ykfde-6dd5a36699b4d46296cff6526f203212ab7405b6.tar.gz
mkinitcpio-ykfde-6dd5a36699b4d46296cff6526f203212ab7405b6.tar.zst
do not allow to give second factor twice
-rw-r--r--bin/ykfde.c12
1 files changed, 12 insertions, 0 deletions
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;