ObjFW  Diff

Differences From Artifact [182b0b3dfd]:

To Artifact [3c90c2bfad]:


537
538
539
540
541
542
543



544
545


546
547
548
549
550
551
552
553
554
555


556
557
558
559
560
561
562
537
538
539
540
541
542
543
544
545
546
547

548
549
550
551
552
553
554
555
556
557
558

559
560
561
562
563
564
565
566
567







+
+
+

-
+
+









-
+
+







	    length: (size_t)length
	  receiver: (const of_udp_socket_address_t*)receiver
{
	if (_socket == INVALID_SOCKET)
		@throw [OFNotOpenException exceptionWithObject: self];

#ifndef _WIN32
	if (length > SSIZE_MAX)
		@throw [OFOutOfRangeException exception];

	if (sendto(_socket, buffer, length, 0,
	    (struct sockaddr*)&receiver->address, receiver->length) < length)
	    (struct sockaddr*)&receiver->address,
	    receiver->length) != (ssize_t)length)
		@throw [OFWriteFailedException
		    exceptionWithObject: self
			requestedLength: length
				  errNo: of_socket_errno()];
#else
	if (length > INT_MAX)
		@throw [OFOutOfRangeException exception];

	if (sendto(_socket, buffer, (int)length, 0,
	    (struct sockaddr*)&receiver->address, receiver->length) < length)
	    (struct sockaddr*)&receiver->address,
	    receiver->length) != (int)length)
		@throw [OFWriteFailedException
		    exceptionWithObject: self
			requestedLength: length
				  errNo: of_socket_errno()];
#endif
}