1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

CIODevice: read(u8*, int) overload should return 0 on EOF

This commit is contained in:
Andreas Kling 2019-09-11 21:13:14 +02:00
parent 81caf95136
commit 38b75d2a97

View file

@ -25,6 +25,8 @@ const char* CIODevice::error_string() const
int CIODevice::read(u8* buffer, int length)
{
auto read_buffer = read(length);
if (read_buffer.is_null())
return 0;
memcpy(buffer, read_buffer.data(), length);
return read_buffer.size();
}