added NULL character to generated key

This commit is contained in:
Václav Šmejkal 2022-05-25 17:58:19 +02:00
parent 35959a4393
commit 5093d2395f

View File

@ -14,7 +14,7 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags)
if (!flags.skipCheck) checkVersion(flags);
//VARIABLES
char *key = malloc(getKeyLength());
char *key = malloc(getKeyLength() + 1);
char *returningText;
char *textBuffer;
int *textKeyChain = malloc(sizeof(int) * strlen(text));
@ -61,6 +61,8 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags)
key[i] = (char) numberBuffer;
}
key[getKeyLength()] = '\0'; //TODO: CHECK IF THIS CAN'T CAUSE SOME LITTLE TROUBLES (SHOULDN'T)
skipKey:
//LOAD textKeyChain