diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-07-08 15:38:44 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-08 15:38:44 +0200 |
commit | 0e75aba7c39c7a2d3b0becc2416aa0e251d62070 (patch) | |
tree | 19bc08a69423db6ab1c6669c06eaab81f494a564 /Libraries/LibGUI/GDesktop.cpp | |
parent | 567551bc12945c25b49c65579ceb545668dbb7eb (diff) | |
download | serenity-0e75aba7c39c7a2d3b0becc2416aa0e251d62070.zip |
StringView: Rename characters() to characters_without_null_termination().
This should make you think twice before trying to use the const char* from
a StringView as if it's a null-terminated string.
Diffstat (limited to 'Libraries/LibGUI/GDesktop.cpp')
-rw-r--r-- | Libraries/LibGUI/GDesktop.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibGUI/GDesktop.cpp b/Libraries/LibGUI/GDesktop.cpp index 809fdc80f0..0c2786b1da 100644 --- a/Libraries/LibGUI/GDesktop.cpp +++ b/Libraries/LibGUI/GDesktop.cpp @@ -29,7 +29,7 @@ bool GDesktop::set_wallpaper(const StringView& path) WSAPI_ClientMessage message; message.type = WSAPI_ClientMessage::Type::SetWallpaper; ASSERT(path.length() < (int)sizeof(message.text)); - strncpy(message.text, path.characters(), path.length()); + strncpy(message.text, path.characters_without_null_termination(), path.length()); message.text_length = path.length(); auto response = GEventLoop::current().sync_request(message, WSAPI_ServerMessage::Type::DidSetWallpaper); return response.value; |