mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-22 09:18:55 +00:00
CIODevice: read(u8*, int) overload should return 0 on EOF
This commit is contained in:
parent
81caf95136
commit
38b75d2a97
Notes:
sideshowbarker
2024-07-19 12:09:24 +09:00
Author: https://github.com/awesomekling
Commit: 38b75d2a97
1 changed files with 2 additions and 0 deletions
|
@ -25,6 +25,8 @@ const char* CIODevice::error_string() const
|
||||||
int CIODevice::read(u8* buffer, int length)
|
int CIODevice::read(u8* buffer, int length)
|
||||||
{
|
{
|
||||||
auto read_buffer = read(length);
|
auto read_buffer = read(length);
|
||||||
|
if (read_buffer.is_null())
|
||||||
|
return 0;
|
||||||
memcpy(buffer, read_buffer.data(), length);
|
memcpy(buffer, read_buffer.data(), length);
|
||||||
return read_buffer.size();
|
return read_buffer.size();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue