ObjFW  Diff

Differences From Artifact [0370baa1c4]:

To Artifact [626dd6d6ed]:


904
905
906
907
908
909
910
911
912

913
914

915
916
917



918
919


920
921

922
923
924
925
926
927
928
929
930
904
905
906
907
908
909
910


911
912

913

914
915
916
917
918


919
920
921

922
923



924
925
926
927
928







-
-
+

-
+
-


+
+
+
-
-
+
+

-
+

-
-
-






	memcpy(node, address->sockaddr.ipx.sipx_node, IPX_NODE_LEN);
}

OFString *
OFSocketAddressUNIXPath(const OFSocketAddress *_Nonnull address)
{
	const socklen_t maxLength = (socklen_t)sizeof(address->sockaddr.un);
	size_t length;
	socklen_t length;

	if (address->family != OFSocketAddressFamilyUNIX ||
	if (address->family != OFSocketAddressFamilyUNIX)
	    address->length > maxLength)
		@throw [OFInvalidArgumentException exception];

	length = address->length - offsetof(struct sockaddr_un, sun_path);

	for (socklen_t i = 0; i < length; i++)
	length = sizeof(address->sockaddr.un.sun_path) -
	    (maxLength - address->length);
		if (address->sockaddr.un.sun_path[i] == 0)
			length = i;

	if (length == 0)
	if (length <= 0)
		return nil;

	while (address->sockaddr.un.sun_path[length - 1] == '\0')
		length--;

	return [OFString stringWithCString: address->sockaddr.un.sun_path
				  encoding: [OFLocale encoding]
				    length: length];
}