mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09: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
Notes:
sideshowbarker
2024-07-19 06:19:44 +09:00
Author: https://github.com/bugaevc
Commit: 776275a747
Pull-request: https://github.com/SerenityOS/serenity/pull/2306
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