ObjFW  Diff

Differences From Artifact [a531eb9595]:

To Artifact [a1cf6370b1]:


29
30
31
32
33
34
35

36
37
38
39
40
41
42
#import "OFChecksumFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFNotImplementedException.h"
#import "OFOpenFileFailedException.h"
#import "OFOutOfRangeException.h"
#import "OFReadFailedException.h"

#import "OFUnsupportedVersionException.h"

#import "autorelease.h"
#import "macros.h"

#define CRC32_MAGIC 0xEDB88320








>







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#import "OFChecksumFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFNotImplementedException.h"
#import "OFOpenFileFailedException.h"
#import "OFOutOfRangeException.h"
#import "OFReadFailedException.h"
#import "OFSeekFailedException.h"
#import "OFUnsupportedVersionException.h"

#import "autorelease.h"
#import "macros.h"

#define CRC32_MAGIC 0xEDB88320

217
218
219
220
221
222
223

224
225






226
227
228
229
230
231
232
{
	void *pool = objc_autoreleasePoolPush();
	uint16_t commentLength;
	off_t offset = -22;
	bool valid = false;

	do {

		[_file seekToOffset: offset
			     whence: SEEK_END];







		if ([_file readLittleEndianInt32] == 0x06054B50) {
			valid = true;
			break;
		}
	} while (--offset >= -65557);








>
|
|
>
>
>
>
>
>







218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
{
	void *pool = objc_autoreleasePoolPush();
	uint16_t commentLength;
	off_t offset = -22;
	bool valid = false;

	do {
		@try {
			[_file seekToOffset: offset
				     whence: SEEK_END];
		} @catch (OFSeekFailedException *e) {
			if ([e errNo] == EINVAL)
				@throw [OFInvalidFormatException exception];

			@throw e;
		}

		if ([_file readLittleEndianInt32] == 0x06054B50) {
			valid = true;
			break;
		}
	} while (--offset >= -65557);