diff --git a/src/core/lib/decrypter.c b/src/core/lib/decrypter.c index 8c14ce7..771327d 100644 --- a/src/core/lib/decrypter.c +++ b/src/core/lib/decrypter.c @@ -75,7 +75,7 @@ outputFlags decryptText(char *text, char *keyNew) } //SET LENGTH (numberBuffer) - returningText = malloc(numberBuffer + 1); + returningText = calloc(numberBuffer + 1, sizeof(char)); textKeyChain = malloc(sizeof(int) * numberBuffer); encryptedTextKeyChain = malloc(sizeof(int) * numberBuffer); textKeyChainLength = numberBuffer; @@ -124,9 +124,6 @@ outputFlags decryptText(char *text, char *keyNew) textKeyChain[i] = getEncryptionOperation()(textKeyChain[i], encryptedTextKeyChain[i]); } - //FIX (CLEAN) returningText - memset(returningText, '\0', textKeyChainLength + 1); - //LOAD returningText for (int i = 0; i < textKeyChainLength; i++) { diff --git a/src/core/lib/misc.c b/src/core/lib/misc.c index 026d148..c05b313 100644 --- a/src/core/lib/misc.c +++ b/src/core/lib/misc.c @@ -137,10 +137,7 @@ boolean checkVersion(void) rewind(fileBuffer); //REWIND fileBuffer (NO SHIT) //SET LENGTH OF buffer - buffer = malloc(bufferSize + 1); - - //FIX buffer - memset(buffer, '\0', bufferSize); + buffer = calloc(bufferSize + 1, sizeof(char)); //LOAD jsonFile (void) (fread(buffer, bufferSize, 1, fileBuffer) + 1); //TODO: Try to create some function for processing exit value