From e2eca1e3ea749c8dbe9bb53a627713539821e19d Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Wed, 25 Jan 2023 20:38:56 +0100 Subject: [PATCH] revert "removed unused void casts" yes so it works on my machine but not on debian-based; fuck reverts commit 8700f38260350cec20b6c48b30eda977018faab9. --- 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 3fb55fa..59e57e2 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 - fread(buffer, bufferSize, 1, fileBuffer); + (void) (fread(buffer, bufferSize, 1, fileBuffer) + 1); //TODO: Try to create some function for processing exit value buffer[bufferSize] = '\0'; @@ -400,7 +400,7 @@ void generateKey(char *key, int keyLength) FILE *fileBuffer; fileBuffer = fopen("/dev/urandom", "r"); - fread(&numberBuffer, sizeof(numberBuffer), 1, fileBuffer); + (void) (fread(&numberBuffer, sizeof(numberBuffer), 1, fileBuffer) + 1); //TODO: Try to create some function for processing exit value numberBuffer = abs(numberBuffer); //MAKE numberBuffer POSITIVE srand(numberBuffer); diff --git a/src/logger/lib/logger.c b/src/logger/lib/logger.c index eaf0705..82fa14a 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 - symlink(latestFilePath + (strlen(WRITE_DIR) + 1), latestBuffer); + (void) (symlink(latestFilePath + (strlen(WRITE_DIR) + 1), latestBuffer) + 1); //TODO: Try to create some function for processing exit value //CREATE 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 - write(loggerFile, buffer, strlen(buffer)); + (void) (write(loggerFile, buffer, strlen(buffer)) + 1); //TODO: Try to create some function for processing exit value //DEALLOCATION free(buffer); diff --git a/src/logger/lib/utils.c b/src/logger/lib/utils.c index 2cb24b6..05f6c1e 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 - fread(rawContent, rawContentL, 1, file); //TODO: Try to create some function for processing exit value + (void) (fread(rawContent, rawContentL, 1, file) + 1); //TODO: Try to create some function for processing exit value for (int i = 0; i < rawContentL; i++) {