removed only char sizeof

'cause char length is 1 lulw
This commit is contained in:
Václav Šmejkal 2022-05-24 18:56:32 +02:00
parent 031bdd0fdb
commit 6282bc6aec
3 changed files with 4 additions and 4 deletions

View File

@ -33,7 +33,7 @@ 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(sizeof(int) * numberBuffer);
int encryptedTextKeyChain[sizeof(int) * numberBuffer]; int encryptedTextKeyChain[sizeof(int) * numberBuffer];
textKeyChainLength = numberBuffer; textKeyChainLength = numberBuffer;

View File

@ -14,7 +14,7 @@ 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(sizeof(int) * strlen(text));
@ -79,7 +79,7 @@ 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

View File

@ -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