summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2023-03-01 17:24:50 +0100
committerLinus Groh <mail@linusgroh.de>2023-03-13 15:16:20 +0000
commitae51c1821c0d32ba40b866d8e5561f6de3359b17 (patch)
tree6bd2d0964841bf5bd56797ad4a887e8e4e3ac63c /Userland/Libraries/LibGUI
parent26516ee1601b0662bb1753f834a179bf1a20082d (diff)
downloadserenity-ae51c1821c0d32ba40b866d8e5561f6de3359b17.zip
Everywhere: Remove unintentional partial stream reads and writes
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r--Userland/Libraries/LibGUI/TextEditor.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp
index 74482ed7bb..8a9cf9ee86 100644
--- a/Userland/Libraries/LibGUI/TextEditor.cpp
+++ b/Userland/Libraries/LibGUI/TextEditor.cpp
@@ -1593,9 +1593,8 @@ ErrorOr<void> TextEditor::write_to_file(Core::File& file)
// A size 0 file doesn't need a data copy.
} else {
for (size_t i = 0; i < line_count(); ++i) {
- // FIXME: This should write the entire span.
- TRY(file.write_some(line(i).to_utf8().bytes()));
- TRY(file.write_some("\n"sv.bytes()));
+ TRY(file.write_until_depleted(line(i).to_utf8().bytes()));
+ TRY(file.write_until_depleted("\n"sv.bytes()));
}
}
document().set_unmodified();