diff options
author | Jelle Raaijmakers <jelle@gmta.nl> | 2022-12-19 00:23:47 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-20 10:34:19 +0100 |
commit | 25f2e4981c1236f69776c290fba7472ec7714869 (patch) | |
tree | bf46d80f5e93fe9590dc990082751c7b320fc9dd /Userland/Utilities | |
parent | 99c1b634fc80c922ca4867e4eac83b73e4c28304 (diff) | |
download | serenity-25f2e4981c1236f69776c290fba7472ec7714869.zip |
AK: Stop using `DeprecatedString` in Base64 encoding
Diffstat (limited to 'Userland/Utilities')
-rw-r--r-- | Userland/Utilities/useradd.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Utilities/useradd.cpp b/Userland/Utilities/useradd.cpp index 146d2c598f..f84e4c19ea 100644 --- a/Userland/Utilities/useradd.cpp +++ b/Userland/Utilities/useradd.cpp @@ -134,18 +134,18 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) } } - auto get_salt = []() { + auto get_salt = []() -> ErrorOr<DeprecatedString> { char random_data[12]; fill_with_random(random_data, sizeof(random_data)); StringBuilder builder; builder.append("$5$"sv); - builder.append(encode_base64(ReadonlyBytes(random_data, sizeof(random_data)))); + builder.append(TRY(encode_base64({ random_data, sizeof(random_data) }))); return builder.build(); }; - char* hash = crypt(password.characters(), get_salt().characters()); + char* hash = crypt(password.characters(), TRY(get_salt()).characters()); struct passwd p; p.pw_name = const_cast<char*>(username.characters()); |