ObjFW  Check-in [431696dee5]

Overview
Comment:OFLHAArchiveEntry: Create more compatible archives
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | 1.0
Files: files | file ages | folders
SHA3-256: 431696dee53c5f659e11508660c2d4a772db670b75fab62f99745863b5e0e3e2
User & Date: js on 2024-02-25 21:19:33
Other Links: branch diff | manifest | tags
Context
2024-02-26
20:09
OFLHAArchive: Properly zero-terminate archives check-in: 4fbf5837fd user: js tags: 1.0
2024-02-25
21:19
OFLHAArchiveEntry: Create more compatible archives check-in: 431696dee5 user: js tags: 1.0
21:19
OFLHAArchiveEntry: Create more compatible archives check-in: 7752f8518b user: js tags: trunk
2024-02-24
22:30
Use `bti c` instead of `bti jc` check-in: 21244a7e62 user: js tags: 1.0
Changes

Modified src/OFLHAArchiveEntry.m from [0138d44106] to [f084e9ff1d].

733
734
735
736
737
738
739








740
741
742
743
744
745
746
		[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)
		@throw [OFOutOfRangeException exception];

	/* Now fill in the size and CRC16 for the entire header */
	tmp16 = OFToLittleEndian16(headerSize);







>
>
>
>
>
>
>
>







733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
		[data addItems: &tmp16 count: sizeof(tmp16)];
		[data addItems: extension.items count: extension.count];
	}

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

	/*
	 * Some implementations only check the first byte to see if the end of
	 * the archive has been reached, which is 0 for every multiple of 256.
	 * Add one byte of padding to avoid this.
	 */
	if ((data.count & 0xFF) == 0)
		[data increaseCountBy: 1];

	headerSize = data.count;

	if (headerSize > UINT16_MAX)
		@throw [OFOutOfRangeException exception];

	/* Now fill in the size and CRC16 for the entire header */
	tmp16 = OFToLittleEndian16(headerSize);