From efab8647a8516cb9f5d2c47ca60e4f4e329a2f9e Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Sun, 8 May 2022 19:41:20 +0200 Subject: [PATCH] added missing flags implementation --- src/lib/decrypter.c | 2 +- src/lib/encrypter.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/decrypter.c b/src/lib/decrypter.c index af766aa..685f8be 100644 --- a/src/lib/decrypter.c +++ b/src/lib/decrypter.c @@ -12,7 +12,7 @@ outputFlags decryptText(char *text, char *key, inputFlags flags) //CHECK FOR INVALID key if (strlen(key) < getKeyLength()) { - fprintf(stderr, "Key must be at least %d characters long!\n", getKeyLength()); + if (!flags.noOutput) fprintf(stderr, "Key must be at least %d characters long!\n", getKeyLength()); exit(INVALID_KEY); } diff --git a/src/lib/encrypter.c b/src/lib/encrypter.c index 1ad1be3..c29f1c2 100644 --- a/src/lib/encrypter.c +++ b/src/lib/encrypter.c @@ -27,7 +27,7 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags) { if (strlen(keyNew) < getKeyLength()) { - fprintf(stderr, "Key must be at least %d characters long!\n", getKeyLength()); + if (!flags.noOutput) fprintf(stderr, "Key must be at least %d characters long!\n", getKeyLength()); exit(INVALID_KEY); }