1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 11:45:11 +00:00

LibGUI: Fix null-termination of TextDocumentLine

This commit is contained in:
Tibor Nagy 2020-03-08 00:57:56 +01:00 committed by Andreas Kling
parent 0c7058aaa0
commit 0d17e3bfa6

View file

@ -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({});
}