mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-13 11:42:38 +03:00
LibC: Don't assert on fflush(nullptr)
We're supposed to flush all open streams when this happens, but since we don't know how to do that yet, let's just log a FIXME and not crash.
This commit is contained in:
parent
e0d589c074
commit
124c588f81
Notes:
sideshowbarker
2024-07-19 09:12:43 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/124c588f817
@ -115,8 +115,10 @@ int feof(FILE* stream)
|
||||
|
||||
int fflush(FILE* stream)
|
||||
{
|
||||
// FIXME: fflush(NULL) should flush all open output streams.
|
||||
ASSERT(stream);
|
||||
if (!stream) {
|
||||
dbg() << "FIXME: fflush(nullptr) should flush all open streams";
|
||||
return 0;
|
||||
}
|
||||
if (!stream->buffer_index)
|
||||
return 0;
|
||||
int rc = write(stream->fd, stream->buffer, stream->buffer_index);
|
||||
|
Loading…
Reference in New Issue
Block a user