From 8700f38260350cec20b6c48b30eda977018faab9 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Wed, 25 Jan 2023 20:37:26 +0100 Subject: [PATCH] removed unused void casts wtf without it, it was throwing compile errors (like month ago) and now it works perfectly fine wtfff --- src/core/lib/misc.c | 4 ++-- src/logger/lib/logger.c | 4 ++-- src/logger/lib/utils.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/lib/misc.c b/src/core/lib/misc.c index 59e57e2..3fb55fa 100644 --- a/src/core/lib/misc.c +++ b/src/core/lib/misc.c @@ -143,7 +143,7 @@ boolean checkVersion(void) memset(buffer, '\0', bufferSize); //LOAD jsonFile - (void) (fread(buffer, bufferSize, 1, fileBuffer) + 1); //TODO: Try to create some function for processing exit value + fread(buffer, bufferSize, 1, fileBuffer); buffer[bufferSize] = '\0'; @@ -400,7 +400,7 @@ void generateKey(char *key, int keyLength) FILE *fileBuffer; fileBuffer = fopen("/dev/urandom", "r"); - (void) (fread(&numberBuffer, sizeof(numberBuffer), 1, fileBuffer) + 1); //TODO: Try to create some function for processing exit value + fread(&numberBuffer, sizeof(numberBuffer), 1, fileBuffer); numberBuffer = abs(numberBuffer); //MAKE numberBuffer POSITIVE srand(numberBuffer); diff --git a/src/logger/lib/logger.c b/src/logger/lib/logger.c index 82fa14a..eaf0705 100644 --- a/src/logger/lib/logger.c +++ b/src/logger/lib/logger.c @@ -83,7 +83,7 @@ logFile initLogger(char *directoryPath) strcpy(latestFilePath, filePath); if (access(latestBuffer, R_OK) == 0) { unlink(latestBuffer); } //REMOVE SYMLINK IF IT ALREADY EXISTS - (void) (symlink(latestFilePath + (strlen(WRITE_DIR) + 1), latestBuffer) + 1); //TODO: Try to create some function for processing exit value //CREATE + symlink(latestFilePath + (strlen(WRITE_DIR) + 1), latestBuffer); deallocation: @@ -143,7 +143,7 @@ void writeLog(int loggerFile, char *logMessage) sprintf(buffer, WRITE_FORMATTING, tm.tm_hour, tm.tm_min, tm.tm_sec, message); //LOAD MESSAGE - (void) (write(loggerFile, buffer, strlen(buffer)) + 1); //TODO: Try to create some function for processing exit value + write(loggerFile, buffer, strlen(buffer)); //DEALLOCATION free(buffer); diff --git a/src/logger/lib/utils.c b/src/logger/lib/utils.c index 05f6c1e..2cb24b6 100644 --- a/src/logger/lib/utils.c +++ b/src/logger/lib/utils.c @@ -67,7 +67,7 @@ decryptedOutput decryptLogger(logFile logger) //TODO: Fix valgrind issues rawContent = calloc(rawContentL + 1, sizeof(char)); //CALLOC WILL BE USED FOR CLEANING AFTER ALLOCATION //LOAD rawContent - (void) (fread(rawContent, rawContentL, 1, file) + 1); //TODO: Try to create some function for processing exit value + fread(rawContent, rawContentL, 1, file); //TODO: Try to create some function for processing exit value for (int i = 0; i < rawContentL; i++) {