removed unused sizeof
fixing my recent mistakes
This commit is contained in:
parent
cea8f06ad8
commit
70a2040bab
@ -33,16 +33,16 @@ outputFlags decryptText(char *text, char *key, inputFlags flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//SET LENGTH (numberBuffer)
|
//SET LENGTH (numberBuffer)
|
||||||
returningText = malloc(sizeof(char) * numberBuffer);
|
returningText = malloc(numberBuffer);
|
||||||
textKeyChain = malloc(sizeof(int) * numberBuffer);
|
textKeyChain = malloc(numberBuffer);
|
||||||
int encryptedTextKeyChain[sizeof(int) * numberBuffer];
|
int encryptedTextKeyChain[numberBuffer];
|
||||||
textKeyChainLength = numberBuffer;
|
textKeyChainLength = numberBuffer;
|
||||||
|
|
||||||
//LOAD textKeyChain
|
//LOAD textKeyChain
|
||||||
generateTextKeyChain(key, textKeyChain, numberBuffer);
|
generateTextKeyChain(key, textKeyChain, numberBuffer);
|
||||||
|
|
||||||
//LOAD encryptedTextKeyChain
|
//LOAD encryptedTextKeyChain
|
||||||
for (int i = 0; i < (sizeof(encryptedTextKeyChain) / sizeof(int)); i++)
|
for (int i = 0; i < sizeof(encryptedTextKeyChain) / sizeof(int); i++)
|
||||||
{
|
{
|
||||||
numberBuffer = 0;
|
numberBuffer = 0;
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ outputFlags decryptText(char *text, char *key, inputFlags flags)
|
|||||||
numberBuffer++;
|
numberBuffer++;
|
||||||
}
|
}
|
||||||
|
|
||||||
textBuffer = malloc(sizeof(char) * numberBuffer);
|
textBuffer = malloc(numberBuffer);
|
||||||
|
|
||||||
//LOAD textBuffer
|
//LOAD textBuffer
|
||||||
for (int j = 0; j < strlen(text); j++)
|
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);
|
if (!flags.skipCheck) checkVersion(flags);
|
||||||
|
|
||||||
//VARIABLES
|
//VARIABLES
|
||||||
char *key = malloc(sizeof(char) * getKeyLength());
|
char *key = malloc(getKeyLength());
|
||||||
char *returningText;
|
char *returningText;
|
||||||
char *textBuffer;
|
char *textBuffer;
|
||||||
int *textKeyChain = malloc(sizeof(int) * strlen(text));
|
int *textKeyChain = malloc(strlen(text));
|
||||||
int numberBuffer;
|
int numberBuffer;
|
||||||
FILE *fileBuffer;
|
FILE *fileBuffer;
|
||||||
|
|
||||||
@ -78,13 +78,13 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//ALLOCATE returningText (WITH THE SEPARATORS)
|
//ALLOCATE returningText (WITH THE SEPARATORS)
|
||||||
returningText = malloc(sizeof(char) * numberBuffer + strlen(text) - 1);
|
returningText = malloc(numberBuffer + strlen(text) - 1);
|
||||||
strcpy(returningText, "");
|
strcpy(returningText, "");
|
||||||
|
|
||||||
//LOAD returningText
|
//LOAD returningText
|
||||||
for (int i = 0; i < strlen(text); i++)
|
for (int i = 0; i < strlen(text); i++)
|
||||||
{
|
{
|
||||||
numberBuffer = sizeof(int) * countIntLength(textKeyChain[i]);
|
numberBuffer = countIntLength(textKeyChain[i]);
|
||||||
|
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
{
|
{
|
||||||
|
@ -59,7 +59,7 @@ void checkVersion(inputFlags flags)
|
|||||||
//COUNT LENGTH OF buffer
|
//COUNT LENGTH OF buffer
|
||||||
fileBuffer = fopen(VERSIONS_NAME, "r");
|
fileBuffer = fopen(VERSIONS_NAME, "r");
|
||||||
fseek(fileBuffer, 0, SEEK_END);
|
fseek(fileBuffer, 0, SEEK_END);
|
||||||
buffer = malloc(sizeof(char) * ftell(fileBuffer));
|
buffer = malloc(ftell(fileBuffer));
|
||||||
fclose(fileBuffer);
|
fclose(fileBuffer);
|
||||||
|
|
||||||
//SET fileBuffer
|
//SET fileBuffer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user