changed decryptLogger type to char**

This commit is contained in:
Václav Šmejkal 2023-01-24 12:17:42 +01:00
parent 6620382d4e
commit 25b2690ab5
Signed by: ENGO150
GPG Key ID: F6D6DF86242C5A59
2 changed files with 4 additions and 5 deletions

View File

@ -22,6 +22,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <why2/logger/flags.h> #include <why2/logger/flags.h>
void deallocateLogger(logFile logger); //USE THIS IF YOU WANT TO DEALLOCATE FILE POINTER RETURNED BY logger'S initLogger 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 #endif

View File

@ -47,7 +47,7 @@ void removeSpaces(char* string)
} while ((*string++ = *d++)); } 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 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++) for (int i = 0; i < buffer3; i++)
{ {
free(linesContent[i]); free(linesContent[i]);
free(linesContentDecrypted[i]); //TODO: Remove
} }
free(linesContent); free(linesContent);
free(linesContentDecrypted); //TODO: Remove
free(rawContent); free(rawContent);
return;
return linesContentDecrypted;
} }