mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibGUI: Fix null-termination of TextDocumentLine
This commit is contained in:
parent
0c7058aaa0
commit
0d17e3bfa6
Notes:
sideshowbarker
2024-07-19 08:50:58 +09:00
Author: https://github.com/xTibor Commit: https://github.com/SerenityOS/serenity/commit/0d17e3bfa61 Pull-request: https://github.com/SerenityOS/serenity/pull/1379
1 changed files with 2 additions and 1 deletions
|
@ -118,7 +118,8 @@ void TextDocumentLine::set_text(TextDocument& document, const StringView& text)
|
|||
return;
|
||||
}
|
||||
m_text.resize((int)text.length() + 1);
|
||||
memcpy(m_text.data(), text.characters_without_null_termination(), text.length() + 1);
|
||||
memcpy(m_text.data(), text.characters_without_null_termination(), text.length());
|
||||
m_text.last() = 0;
|
||||
document.update_views({});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue