reverted the sizeof removing
I have no idea
This commit is contained in:
parent
d63c97614f
commit
ef4f9f5084
@ -33,16 +33,16 @@ outputFlags decryptText(char *text, char *key, inputFlags flags)
|
||||
}
|
||||
|
||||
//SET LENGTH (numberBuffer)
|
||||
returningText = malloc(numberBuffer);
|
||||
textKeyChain = malloc(numberBuffer);
|
||||
int encryptedTextKeyChain[numberBuffer];
|
||||
returningText = malloc(sizeof(char) * numberBuffer);
|
||||
textKeyChain = malloc(sizeof(int) * numberBuffer);
|
||||
int encryptedTextKeyChain[sizeof(int) * numberBuffer];
|
||||
textKeyChainLength = numberBuffer;
|
||||
|
||||
//LOAD textKeyChain
|
||||
generateTextKeyChain(key, textKeyChain, numberBuffer);
|
||||
|
||||
//LOAD encryptedTextKeyChain
|
||||
for (int i = 0; i < sizeof(encryptedTextKeyChain) / sizeof(int); i++)
|
||||
for (int i = 0; i < (sizeof(encryptedTextKeyChain) / sizeof(int)); i++)
|
||||
{
|
||||
numberBuffer = 0;
|
||||
|
||||
@ -54,7 +54,7 @@ outputFlags decryptText(char *text, char *key, inputFlags flags)
|
||||
numberBuffer++;
|
||||
}
|
||||
|
||||
textBuffer = malloc(numberBuffer);
|
||||
textBuffer = malloc(sizeof(char) * numberBuffer);
|
||||
|
||||
//LOAD textBuffer
|
||||
for (int j = 0; j < strlen(text); j++)
|
||||
|
@ -14,10 +14,10 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags)
|
||||
if (!flags.skipCheck) checkVersion(flags);
|
||||
|
||||
//VARIABLES
|
||||
char *key = malloc(getKeyLength());
|
||||
char *key = malloc(sizeof(char) * getKeyLength());
|
||||
char *returningText;
|
||||
char *textBuffer;
|
||||
int *textKeyChain = malloc(strlen(text));
|
||||
int *textKeyChain = malloc(sizeof(int) * strlen(text));
|
||||
int numberBuffer;
|
||||
FILE *fileBuffer;
|
||||
|
||||
@ -79,13 +79,13 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags)
|
||||
}
|
||||
|
||||
//ALLOCATE returningText (WITH THE SEPARATORS)
|
||||
returningText = malloc(numberBuffer + strlen(text) - 1);
|
||||
returningText = malloc(sizeof(char) * numberBuffer + strlen(text) - 1);
|
||||
strcpy(returningText, "");
|
||||
|
||||
//LOAD returningText
|
||||
for (int i = 0; i < strlen(text); i++)
|
||||
{
|
||||
numberBuffer = countIntLength(textKeyChain[i]);
|
||||
numberBuffer = sizeof(int) * countIntLength(textKeyChain[i]);
|
||||
|
||||
if (i != 0)
|
||||
{
|
||||
|
@ -59,7 +59,7 @@ void checkVersion(inputFlags flags)
|
||||
//COUNT LENGTH OF buffer
|
||||
fileBuffer = fopen(VERSIONS_NAME, "r");
|
||||
fseek(fileBuffer, 0, SEEK_END);
|
||||
buffer = malloc(ftell(fileBuffer));
|
||||
buffer = malloc(sizeof(char) * ftell(fileBuffer));
|
||||
fclose(fileBuffer);
|
||||
|
||||
//SET fileBuffer
|
||||
|
Loading…
x
Reference in New Issue
Block a user