Skip to content

Commit

Permalink
Fixes from PhysicsFS for non-Zip64 archives.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jun 7, 2012
1 parent c15d187 commit 4e79a25
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion archive_zip.c
Expand Up @@ -173,7 +173,8 @@ void __PHYSFS_sort(void *entries, size_t max,
* Quicksort w/ Bubblesort fallback algorithm inspired by code from here:
* http://www.cs.ubc.ca/spider/harrison/Java/sorting-demo.html
*/
__PHYSFS_quick_sort(entries, 0, max - 1, cmpfn, swapfn);
if (max > 0)
__PHYSFS_quick_sort(entries, 0, max - 1, cmpfn, swapfn);
} /* __PHYSFS_sort */


Expand Down Expand Up @@ -1514,6 +1515,8 @@ static int zip_parse_end_of_central_dir(void *in, ZIPinfo *info,
BAIL_IF_MACRO(!readui16(in, &entryCount16), ERRPASS, 0);
BAIL_IF_MACRO(ui16 != entryCount16, PHYSFS_ERR_CORRUPT, 0);

info->entryCount = entryCount16;

/* size of the central directory */
BAIL_IF_MACRO(!readui32(in, &ui32), NULL, 0);

Expand Down

0 comments on commit 4e79a25

Please sign in to comment.