fixed countRepeatedKeySize result

I forgot that the key has to be 2x longer than text

TEXT = Hi, KEY = abcd
This commit is contained in:
Václav Šmejkal 2022-08-25 11:11:35 +02:00
parent 3421fb5b70
commit 916c670e4b
No known key found for this signature in database
GPG Key ID: FD749A97DF2D5E19

View File

@ -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;