replaced deallocateDoublePointer with deallocateDecryptedOutput
This commit is contained in:
parent
e7282dec5a
commit
d16f48b760
@ -22,7 +22,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#include <why2/logger/flags.h>
|
||||
|
||||
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
|
||||
void deallocateDecryptedOutput(decryptedOutput output); //DEALLOCATION OF POINTER-TO-POINTER, WHY TF ARE YOU READING THIS
|
||||
decryptedOutput decryptLogger(logFile logger); //PASS logger AND FLAGS, AND PROGRAM WILL DECRYPT YOUR LOG... WHAT DID YOU EXPECT?
|
||||
|
||||
#endif
|
@ -35,21 +35,15 @@ void deallocateLogger(logFile logger)
|
||||
free(logger.fileName);
|
||||
}
|
||||
|
||||
void deallocateDoublePointer(char **string)
|
||||
void deallocateDecryptedOutput(decryptedOutput output)
|
||||
{
|
||||
int buffer = 0;
|
||||
|
||||
for (; 1; buffer++) //GET string SIZE (FIRST DIM)
|
||||
for (int i = 0; i < output.length; i++)
|
||||
{
|
||||
if (!string[buffer]) break;
|
||||
free(output.decryptedText[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < buffer; i++) //LOAD ELEMENTS
|
||||
{
|
||||
free(string[i]); //DEALLOCATE ELEMENTS
|
||||
}
|
||||
|
||||
free(string); //no
|
||||
output.length = 0;
|
||||
free(output.decryptedText);
|
||||
}
|
||||
|
||||
decryptedOutput decryptLogger(logFile logger) //TODO: Fix valgrind issues
|
||||
|
Loading…
x
Reference in New Issue
Block a user