mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:17:45 +00:00
LibCore: Use StringView
instead of char *
in Account
This commit is contained in:
parent
0396b6da82
commit
507cb411c2
10 changed files with 33 additions and 36 deletions
|
@ -98,9 +98,9 @@ ErrorOr<Account> Account::self([[maybe_unused]] Read options)
|
|||
return Account(*pwd, spwd, extra_gids);
|
||||
}
|
||||
|
||||
ErrorOr<Account> Account::from_name(char const* username, [[maybe_unused]] Read options)
|
||||
ErrorOr<Account> Account::from_name(StringView username, [[maybe_unused]] Read options)
|
||||
{
|
||||
auto pwd = TRY(Core::System::getpwnam({ username, strlen(username) }));
|
||||
auto pwd = TRY(Core::System::getpwnam(username));
|
||||
if (!pwd.has_value())
|
||||
return Error::from_string_literal("No such user");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue