replaced all memset with calloc
This commit is contained in:
parent
44bc62c73b
commit
c75c4fd84b
@ -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++)
|
||||
{
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user