ObjFW  Check-in [7752f8518b]

Overview
Comment:OFLHAArchiveEntry: Create more compatible archives
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 7752f8518b459b3552172e2ec6a60287142c142fa6a67beffb05679309d3e11f
User & Date: js on 2024-02-25 21:19:25
Other Links: manifest | tags
Context
2024-02-26
20:09
OFLHAArchive: Properly zero-terminate archives check-in: 413965aa27 user: js tags: trunk
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
01:08
Backport associated objects to old Apple runtime check-in: 2d8c6a004d user: js tags: trunk
Changes

Modified src/OFLHAArchiveEntry.m from [76b8e70f25] to [fa0ccd29a1].

746
747
748
749
750
751
752








753
754
755
756
757
758
759
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767







+
+
+
+
+
+
+
+







		[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);