Added total listed size
This commit is contained in:
parent
3000681f02
commit
825b1a8479
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user