Skip to content

Commit

Permalink
Tried fixing remaining long long type issues (Issue #37)
Browse files Browse the repository at this point in the history
  • Loading branch information
abbeycode committed Aug 10, 2016
1 parent 5f43698 commit b112e74
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source/UZKArchive.m
Original file line number Diff line number Diff line change
Expand Up @@ -1139,8 +1139,8 @@ - (BOOL)deleteFile:(NSString *)filePath error:(NSError * __autoreleasing*)error
currentFileName, filePath]];
}

// This malloc may fail if file very large
void *buf = malloc(unzipInfo.compressed_size);
// This malloc may fail if the file is very large
void *buf = malloc((unsigned long)unzipInfo.compressed_size);
if ((buf == NULL) && (unzipInfo.compressed_size != 0)) {
free(extrafield);
free(commentary);
Expand Down Expand Up @@ -1196,7 +1196,7 @@ - (BOOL)deleteFile:(NSString *)filePath error:(NSError * __autoreleasing*)error
}

// Close destination archive
err = zipCloseFileInZipRaw(destZip, unzipInfo.uncompressed_size, unzipInfo.crc);
err = zipCloseFileInZipRaw64(destZip, unzipInfo.uncompressed_size, unzipInfo.crc);
if (err != UNZ_OK) {
free(extrafield);
free(commentary);
Expand Down Expand Up @@ -1744,7 +1744,7 @@ - (NSData *)readFile:(NSString *)filePath length:(unsigned long long int)length
return nil;
}

NSMutableData *data = [NSMutableData dataWithLength:length];
NSMutableData *data = [NSMutableData dataWithLength:(NSUInteger)length];
int bytes = unzReadCurrentFile(self.unzFile, data.mutableBytes, (unsigned)length);

if (bytes < 0) {
Expand Down

0 comments on commit b112e74

Please sign in to comment.