diff --git a/DCTar.m b/DCTar.m index 87abf33..237963b 100644 --- a/DCTar.m +++ b/DCTar.m @@ -312,10 +312,11 @@ +(BOOL)untarObject:(id)tarObject size:(unsigned long long)size toPath:(NSString* //NSLog(@"file created: %@",name); if(size == 0) { - [@"" writeToFile:filePath atomically:YES encoding:NSUTF8StringEncoding error:error]; + [@"" writeToFile:filePath atomically:YES encoding:NSUTF8StringEncoding error:nil]; + } else { + blockCount += (size - 1) / TAR_BLOCK_SIZE + 1; // size/TAR_BLOCK_SIZE rounded up } - blockCount += (size - 1) / TAR_BLOCK_SIZE + 1; // size/TAR_BLOCK_SIZE rounded up [self writeFileDataForObject:tarObject atLocation:(location + TAR_BLOCK_SIZE) withLength:size atPath:filePath]; } else if(type == '5') {