ObjFW  Diff

Differences From Artifact [3604f250d5]:

To Artifact [d95eac9ee4]:


634
635
636
637
638
639
640
641
642
643

644
645
646
647
648
649
650
651
652
653
654
655

	return atEndOfStream;
}

- (size_t)_readNBytes: (size_t)length
	   intoBuffer: (void*)buffer
{
	size_t ret;

	if (fileDescriptor == -1 || atEndOfStream)

		@throw [OFReadFailedException exceptionWithClass: isa
							  stream: self
						 requestedLength: length];

	if ((ret = read(fileDescriptor, buffer, length)) == 0)
		atEndOfStream = YES;

	return ret;
}

- (void)_writeNBytes: (size_t)length
	  fromBuffer: (const void*)buffer







|

|
>




|







634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656

	return atEndOfStream;
}

- (size_t)_readNBytes: (size_t)length
	   intoBuffer: (void*)buffer
{
	ssize_t ret;

	if (fileDescriptor == -1 || atEndOfStream ||
	    (ret = read(fileDescriptor, buffer, length)) < 0)
		@throw [OFReadFailedException exceptionWithClass: isa
							  stream: self
						 requestedLength: length];

	if (ret == 0)
		atEndOfStream = YES;

	return ret;
}

- (void)_writeNBytes: (size_t)length
	  fromBuffer: (const void*)buffer