Padding is harmless.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2735 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
Meep-Eep
2007-04-15 23:58:42 +00:00
parent fdd4e1fe83
commit 780d7a74ae
+9 -1
View File
@@ -724,7 +724,7 @@ analyzeFilesStats(struct options *opts, const index_header *h,
// one package with 2 instances. // one package with 2 instances.
// The DOS version of SC1 and the 3DO version of SC2 have // The DOS version of SC1 and the 3DO version of SC2 have
// no such overflows. // no such overflows.
fprintf(stderr, "Package #%d: Size is 0x%08x; " fprintf(stderr, "Package #%d: Size 0x%08x; "
"Expected 0x%08x. %d instances. ", pack->index, "Expected 0x%08x. %d instances. ", pack->index,
pack->size, expectedSize, pack->num_instances); pack->size, expectedSize, pack->num_instances);
if (pack->size < expectedSize && if (pack->size < expectedSize &&
@@ -732,6 +732,14 @@ analyzeFilesStats(struct options *opts, const index_header *h,
fprintf(stderr, "Correcting.\n"); fprintf(stderr, "Correcting.\n");
pack->size = expectedSize; pack->size = expectedSize;
lastInstance(pack)->size += missing; lastInstance(pack)->size += missing;
} else if (packI == stats->numPackages - 1 &&
pack->size + multiplier > expectedSize) {
// It's possible that the package itself came from
// another package; in that case, there might be up to
// multiplier - 1 bytes of padding to the end of the
// package file to make the size a multiple of
// 'multiplier'.
fprintf(stderr, "Just padding.\n");
} else { } else {
fprintf(stderr, "KEPT VALUE!\n"); fprintf(stderr, "KEPT VALUE!\n");
} }