mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:07:36 +00:00
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.
This commit is contained in:
parent
567551bc12
commit
0e75aba7c3
21 changed files with 57 additions and 46 deletions
|
@ -32,7 +32,7 @@ public:
|
|||
ByteBuffer read_all();
|
||||
|
||||
bool write(const u8*, int size);
|
||||
bool write(const AK::StringView& v) { return write((const u8*)v.characters(), v.length()); }
|
||||
bool write(const StringView& v) { return write((const u8*)v.characters_without_null_termination(), v.length()); }
|
||||
|
||||
// FIXME: I would like this to be const but currently it needs to call populate_read_buffer().
|
||||
bool can_read_line();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue