From e7282dec5ada8c4eb3c446288225cded943a5673 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Wed, 25 Jan 2023 13:50:47 +0100 Subject: [PATCH] changed decrypLogger type to decryptedOutput cuz length --- include/logger/utils.h | 2 +- src/logger/lib/utils.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/logger/utils.h b/include/logger/utils.h index 0d26417..3b5b230 100644 --- a/include/logger/utils.h +++ b/include/logger/utils.h @@ -23,6 +23,6 @@ along with this program. If not, see . void deallocateLogger(logFile logger); //USE THIS IF YOU WANT TO DEALLOCATE FILE POINTER RETURNED BY logger'S initLogger void deallocateDoublePointer(char **string); //DEALLOCATION OF POINTER-TO-POINTER, WHY TF ARE YOU READING THIS -char **decryptLogger(logFile logger); //PASS logger AND FLAGS, AND PROGRAM WILL DECRYPT YOUR LOG... WHAT DID YOU EXPECT? +decryptedOutput 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 4aa5728..dbbc6d4 100644 --- a/src/logger/lib/utils.c +++ b/src/logger/lib/utils.c @@ -52,7 +52,7 @@ void deallocateDoublePointer(char **string) free(string); //no } -char **decryptLogger(logFile logger) //TODO: Fix valgrind issues +decryptedOutput decryptLogger(logFile logger) //TODO: Fix valgrind issues { FILE *file = fdopen(logger.file, "r"); outputFlags outputBuffer; @@ -114,5 +114,9 @@ char **decryptLogger(logFile logger) //TODO: Fix valgrind issues fclose(file); deallocateDoublePointer(content); - return contentDecrypted; + return (decryptedOutput) + { + contentDecrypted, + lines + }; } \ No newline at end of file