Added total listed size

This commit is contained in:
TriantaTV 2022-11-13 20:24:11 -06:00
parent 3000681f02
commit 825b1a8479

View File

@ -226,6 +226,7 @@ void RemoveFromArchive(char* archiveName, char* filename)
void ListArchive(char* archiveName)
{
int archiveFile = open(archiveName, O_RDONLY);
int totalSize = 0;
ssize_t readSize;
SafetyCheck((archiveFile < 0), "Archive failed to open.");
ModuleStruct module;
@ -235,9 +236,11 @@ void ListArchive(char* archiveName)
if (readSize > 0)
{
PrintModuleHeader(&module);
totalSize += module.moduleHeader.moduleInfo.st_size;
free(module.moduleData);
}
} while (readSize > 0);
printf("Total Size: %i\n", totalSize);
return;
}