changed info to static allocation

This commit is contained in:
Paul Cruz 2017-06-15 15:35:37 -07:00
parent 96cabf7233
commit 8b3ff7c9bc

View File

@ -1000,7 +1000,6 @@ void displayInfo(const char* inFileName, fileInfo_t* info, int displayLevel){
double const compressedSizeMB = (double)info->compressedSize/(1 MB); double const compressedSizeMB = (double)info->compressedSize/(1 MB);
double const decompressedSizeMB = (double)info->decompressedSize/(1 MB); double const decompressedSizeMB = (double)info->decompressedSize/(1 MB);
const char* checkString = (info->usesCheck ? "XXH64" : "None"); const char* checkString = (info->usesCheck ? "XXH64" : "None");
if(displayLevel<=2){ if(displayLevel<=2){
if (info->canComputeDecompSize) { if (info->canComputeDecompSize) {
DISPLAYOUT("Skippable Non-Skippable Compressed Uncompressed Ratio Check Filename\n"); DISPLAYOUT("Skippable Non-Skippable Compressed Uncompressed Ratio Check Filename\n");
@ -1031,15 +1030,14 @@ void displayInfo(const char* inFileName, fileInfo_t* info, int displayLevel){
} }
int FIO_listFile(const char* inFileName, int displayLevel){ int FIO_listFile(const char* inFileName, int displayLevel){
DISPLAY("File: %s\n", inFileName); DISPLAYOUT("File: %s\n", inFileName);
fileInfo_t* info = (fileInfo_t*)malloc(sizeof(fileInfo_t)); fileInfo_t info;
int error = getFileInfo(info, inFileName); int const error = getFileInfo(&info, inFileName);
if (error == 1) { if (error == 1) {
DISPLAY("An error occurred with getting file info\n"); DISPLAY("An error occurred with getting file info\n");
return 1; return 1;
} }
displayInfo(inFileName, info, displayLevel); displayInfo(inFileName, &info, displayLevel);
free(info);
return 0; return 0;
} }