mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:24:57 +00:00
Everywhere: Explicitly specify the size in StringView constructors
This commit moves the length calculations out to be directly on the StringView users. This is an important step towards the goal of removing StringView(char const*), as it moves the responsibility of calculating the size of the string to the user of the StringView (which will prevent naive uses causing OOB access).
This commit is contained in:
parent
e3da0adfe6
commit
c70f45ff44
75 changed files with 264 additions and 203 deletions
|
@ -144,7 +144,7 @@ static void parse_args(Main::Arguments arguments, TopOption& top_option)
|
|||
's',
|
||||
nullptr,
|
||||
[&top_option](char const* s) {
|
||||
StringView sort_by_option { s };
|
||||
StringView sort_by_option { s, strlen(s) };
|
||||
if (sort_by_option == "pid"sv)
|
||||
top_option.sort_by = TopOption::SortBy::Pid;
|
||||
else if (sort_by_option == "tid"sv)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue