diff --git a/src/lib/encrypter.c b/src/lib/encrypter.c index a51f06c..a5ea709 100644 --- a/src/lib/encrypter.c +++ b/src/lib/encrypter.c @@ -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