1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:37:45 +00:00

LibCore: Use StringView instead of char * in Account

This commit is contained in:
Lucas CHOLLET 2022-06-10 20:06:06 +02:00 committed by Sam Atkins
parent 0396b6da82
commit 507cb411c2
10 changed files with 33 additions and 36 deletions

View file

@ -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");