From 09aa76a33dac5617c78274e462268ccb61a9c35e Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Wed, 24 Aug 2022 15:49:15 +0200 Subject: [PATCH] created code for countRepeatedKeySize WARNING: This will work only if you don't change textKeyChain gen, so pls don't --- src/lib/misc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/misc.c b/src/lib/misc.c index 1bfadfe..bc2e986 100644 --- a/src/lib/misc.c +++ b/src/lib/misc.c @@ -353,8 +353,14 @@ unsigned long countUnusedKeySize(char *text, char *key) unsigned long countRepeatedKeySize(UNUSED char *text, UNUSED char *key) { - //TODO: FIX - return 0; + unsigned long returning = 0; + + if (strlen(key) < strlen(text)) + { + returning = strlen(text) - strlen(key); + } + + return returning; } unsigned long compareTimeMicro(struct timeval startTime, struct timeval finishTime)