mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:37:44 +00:00
LibCore+Everywhere: Remove ArgsParser::add*(char const*&)
This is not guaranteed to always work correctly as ArgsParser deals in StringViews and might have a non-properly-null-terminated string as a value. As a bonus, using StringView (and DeprecatedString where necessary) leads to nicer looking code too :^)
This commit is contained in:
parent
60908adcbe
commit
500044906d
43 changed files with 122 additions and 145 deletions
|
@ -25,7 +25,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
{
|
||||
TRY(Core::System::pledge("stdio id inet unix"));
|
||||
|
||||
char const* host_name;
|
||||
DeprecatedString host_name;
|
||||
int max_hops = 30;
|
||||
int max_retries = 3;
|
||||
int echo_timeout = 5;
|
||||
|
@ -45,7 +45,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
return Error::from_string_literal("Invalid maximum retries amount");
|
||||
}
|
||||
|
||||
auto* hostent = gethostbyname(host_name);
|
||||
auto* hostent = gethostbyname(host_name.characters());
|
||||
if (!hostent) {
|
||||
warnln("Lookup failed for '{}'", host_name);
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue