mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:37:35 +00:00
LibC: Handle fgets(size = 0)
I accidentally broke this in the recent rewrite. This reinstantiates the
behavior implemented in 6571468525
.
This commit is contained in:
parent
da23514431
commit
776275a747
1 changed files with 3 additions and 0 deletions
|
@ -324,6 +324,9 @@ bool FILE::gets(u8* data, size_t size)
|
|||
// separate implementation.
|
||||
size_t total_read = 0;
|
||||
|
||||
if (size == 0)
|
||||
return false;
|
||||
|
||||
while (size > 1) {
|
||||
if (m_buffer.may_use()) {
|
||||
// Let's see if the buffer has something queued for us.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue