From 6282bc6aecdae47653efae9259edbb6ef78cf9ab Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Tue, 24 May 2022 18:56:32 +0200 Subject: [PATCH] removed only char sizeof 'cause char length is 1 lulw --- src/lib/decrypter.c | 2 +- src/lib/encrypter.c | 4 ++-- src/lib/misc.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/decrypter.c b/src/lib/decrypter.c index 577c4b5..a2a7c3d 100644 --- a/src/lib/decrypter.c +++ b/src/lib/decrypter.c @@ -33,7 +33,7 @@ outputFlags decryptText(char *text, char *key, inputFlags flags) } //SET LENGTH (numberBuffer) - returningText = malloc(sizeof(char) * numberBuffer); + returningText = malloc(numberBuffer); textKeyChain = malloc(sizeof(int) * numberBuffer); int encryptedTextKeyChain[sizeof(int) * numberBuffer]; textKeyChainLength = numberBuffer; diff --git a/src/lib/encrypter.c b/src/lib/encrypter.c index 44f4ce3..a51f06c 100644 --- a/src/lib/encrypter.c +++ b/src/lib/encrypter.c @@ -14,7 +14,7 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags) if (!flags.skipCheck) checkVersion(flags); //VARIABLES - char *key = malloc(sizeof(char) * getKeyLength()); + char *key = malloc(getKeyLength()); char *returningText; char *textBuffer; int *textKeyChain = malloc(sizeof(int) * strlen(text)); @@ -79,7 +79,7 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags) } //ALLOCATE returningText (WITH THE SEPARATORS) - returningText = malloc(sizeof(char) * numberBuffer + strlen(text) - 1); + returningText = malloc(numberBuffer + strlen(text) - 1); strcpy(returningText, ""); //LOAD returningText diff --git a/src/lib/misc.c b/src/lib/misc.c index d6674e8..d332758 100644 --- a/src/lib/misc.c +++ b/src/lib/misc.c @@ -59,7 +59,7 @@ void checkVersion(inputFlags flags) //COUNT LENGTH OF buffer fileBuffer = fopen(VERSIONS_NAME, "r"); fseek(fileBuffer, 0, SEEK_END); - buffer = malloc(sizeof(char) * ftell(fileBuffer)); + buffer = malloc(ftell(fileBuffer)); fclose(fileBuffer); //SET fileBuffer