ObjFW  Diff

Differences From Artifact [944c9a1051]:

To Artifact [6d92ac1a5f]:


292
293
294
295
296
297
298
299
300
301
302
303
304
305
306

	if (_stream == nil)
		@throw [OFNotOpenException exceptionWithObject: self];

	if (_atEndOfStream)
		return 0;

	if (length > UINT64_MAX)
		@throw [OFOutOfRangeException exception];

	if ((uint64_t)length > _toRead)
		length = (size_t)_toRead;

	ret = [_stream readIntoBuffer: buffer
			       length: length];







|







292
293
294
295
296
297
298
299
300
301
302
303
304
305
306

	if (_stream == nil)
		@throw [OFNotOpenException exceptionWithObject: self];

	if (_atEndOfStream)
		return 0;

	if (sizeof(length) >= sizeof(uint64_t) && length > UINT64_MAX)
		@throw [OFOutOfRangeException exception];

	if ((uint64_t)length > _toRead)
		length = (size_t)_toRead;

	ret = [_stream readIntoBuffer: buffer
			       length: length];