From 25b2690ab5c446771e0b9a65595413d67d7ab7e0 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Tue, 24 Jan 2023 12:17:42 +0100 Subject: [PATCH] changed decryptLogger type to char** --- include/logger/utils.h | 2 +- src/logger/lib/utils.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/logger/utils.h b/include/logger/utils.h index f8cab39..580f460 100644 --- a/include/logger/utils.h +++ b/include/logger/utils.h @@ -22,6 +22,6 @@ along with this program. If not, see . #include void deallocateLogger(logFile logger); //USE THIS IF YOU WANT TO DEALLOCATE FILE POINTER RETURNED BY logger'S initLogger -void decryptLogger(logFile logger); //PASS logger AND FLAGS, AND PROGRAM WILL DECRYPT YOUR LOG... WHAT DID YOU EXPECT? +char **decryptLogger(logFile logger); //PASS logger AND FLAGS, AND PROGRAM WILL DECRYPT YOUR LOG... WHAT DID YOU EXPECT? #endif \ No newline at end of file diff --git a/src/logger/lib/utils.c b/src/logger/lib/utils.c index 26afb6f..e76aa75 100644 --- a/src/logger/lib/utils.c +++ b/src/logger/lib/utils.c @@ -47,7 +47,7 @@ void removeSpaces(char* string) } while ((*string++ = *d++)); } -void decryptLogger(logFile logger) //TODO: Fix valgrind issues +char **decryptLogger(logFile logger) //TODO: Fix valgrind issues { FILE *file = fdopen(logger.file, "r"); //OPEN logFile AS FILE POINTER @@ -134,12 +134,11 @@ void decryptLogger(logFile logger) //TODO: Fix valgrind issues for (int i = 0; i < buffer3; i++) { free(linesContent[i]); - free(linesContentDecrypted[i]); //TODO: Remove } free(linesContent); - free(linesContentDecrypted); //TODO: Remove free(rawContent); - return; + + return linesContentDecrypted; } \ No newline at end of file