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:
Sergey Bugaev 2020-05-20 14:56:13 +03:00 committed by Andreas Kling
parent da23514431
commit 776275a747
Notes: sideshowbarker 2024-07-19 06:19:44 +09:00

View File

@ -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.