ObjFW  Check-in [4e5688382f]

Overview
Comment:OFLHAArchive: Write extensions
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4e5688382f337d48a618c6d0c501f65c4993bb7577e0738844da24a3b50b6242
User & Date: js on 2018-06-17 11:19:06
Other Links: manifest | tags
Context
2018-06-17
15:29
.travis.yml: Update Xcode versions check-in: 71479e9390 user: js tags: trunk
11:19
OFLHAArchive: Write extensions check-in: 4e5688382f user: js tags: trunk
11:03
OFLHAArchive: Correctly write directory name check-in: 816ec4d0f5 user: js tags: trunk
Changes

Modified src/OFLHAArchiveEntry.m from [d1563d1ec0] to [dc72e4d9e8].

717
718
719
720
721
722
723
















724
725
726
727
728
729
730
		[data addItem: "\x54"];

		tmp32 = OF_BSWAP32_IF_BE(
		    (uint32_t)[_modificationDate timeIntervalSince1970]);
		[data addItems: &tmp32
			 count: sizeof(tmp32)];
	}

















	/* Zero-length extension to terminate */
	[data increaseCountBy: 2];

	headerSize = [data count];

	if (headerSize > UINT16_MAX)







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
		[data addItem: "\x54"];

		tmp32 = OF_BSWAP32_IF_BE(
		    (uint32_t)[_modificationDate timeIntervalSince1970]);
		[data addItems: &tmp32
			 count: sizeof(tmp32)];
	}

	for (OFData *extension in _extensions) {
		size_t extensionLength = [extension count];

		if ([extension itemSize] != 1)
			@throw [OFInvalidArgumentException exception];

		if (extensionLength > UINT16_MAX - 2)
			@throw [OFOutOfRangeException exception];

		tmp16 = OF_BSWAP16_IF_BE((uint16_t)extensionLength + 2);
		[data addItems: &tmp16
			 count: sizeof(tmp16)];
		[data addItems: [extension items]
			 count: [extension count]];
	}

	/* Zero-length extension to terminate */
	[data increaseCountBy: 2];

	headerSize = [data count];

	if (headerSize > UINT16_MAX)