diff --git a/src/stuffy.c b/src/stuffy.c index 1601d9e..9419a58 100644 --- a/src/stuffy.c +++ b/src/stuffy.c @@ -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; }