From 916c670e4bc81210f743b5c27ec14e3532154cd3 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Thu, 25 Aug 2022 11:11:35 +0200 Subject: [PATCH] fixed countRepeatedKeySize result I forgot that the key has to be 2x longer than text TEXT = Hi, KEY = abcd --- src/lib/misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/misc.c b/src/lib/misc.c index b89979f..1f3699c 100644 --- a/src/lib/misc.c +++ b/src/lib/misc.c @@ -355,9 +355,9 @@ unsigned long countRepeatedKeySize(char *text, char *key) { unsigned long returning = 0; - if (strlen(key) < strlen(text)) + if (strlen(key) < 2 * strlen(text)) { - returning = strlen(text) - strlen(key); + returning = 2 * strlen(text) - strlen(key); } return returning;