ObjFW  Check-in [75a8f74494]

Overview
Comment:Fix build for AmigaOS
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 75a8f74494115d8422ce76d9f503b4b1e07a0d7fb79ce0a563f6e0bd0a286139
User & Date: js on 2024-03-03 20:45:23
Other Links: manifest | tags
Context
2024-03-03
23:33
ofarc: Add --iri option check-in: 370e91ddce user: js tags: trunk
20:45
Fix build for AmigaOS check-in: 75a8f74494 user: js tags: trunk
20:03
OFLHAArchive: Don't default to ISO 8859-1 check-in: b8afc53cce user: js tags: trunk
Changes

Modified src/OFZooArchive.m from [412525e4b5] to [a292f6c75d].

254
255
256
257
258
259
260
261

262


263
264
265
266
267
268
269
254
255
256
257
258
259
260

261
262
263
264
265
266
267
268
269
270
271







-
+

+
+







	unsigned char *buffer;

	if (_lastHeaderOffset == 0)
		return;

	offset = [_stream seekToOffset: 0 whence: OFSeekCurrent];

	if (offset < 0 || offset > UINT32_MAX || _lastHeaderLength < 56)
	if (offset < 0 || (unsigned long long)offset > UINT32_MAX)
		@throw [OFOutOfRangeException exception];

	OFEnsure(_lastHeaderLength >= 56);

	[_stream seekToOffset: _lastHeaderOffset whence: OFSeekSet];
	buffer = OFAllocMemory(1, _lastHeaderLength);
	@try {
		uint16_t tmp16;
		uint32_t tmp32;

595
596
597
598
599
600
601
602

603
604
605
606
607
608
609
597
598
599
600
601
602
603

604
605
606
607
608
609
610
611







-
+








	_entry.uncompressedSize = _bytesWritten;
	_entry.compressedSize = _bytesWritten;
	_entry.CRC16 = _CRC16;

	offset = [_stream seekToOffset: 0 whence: OFSeekCurrent];

	if (offset > UINT32_MAX)
	if ((unsigned long long)offset > UINT32_MAX)
		@throw [OFOutOfRangeException exception];

	[_stream seekToOffset: *_lastHeaderOffset whence: OFSeekSet];
	_entry->_dataOffset = (uint32_t)offset;

	OFEnsure([_entry of_writeToStream: _stream
				 encoding: _encoding] == *_lastHeaderLength);