ObjFW  Diff

Differences From Artifact [d1563d1ec0]:

To Artifact [dc72e4d9e8]:


717
718
719
720
721
722
723
















724
725
726
727
728
729
730
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)