mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:24:57 +00:00
AK+Userland: Make AK::decode_base64 return ErrorOr
This commit is contained in:
parent
f590cd1850
commit
c388a879d7
11 changed files with 31 additions and 43 deletions
|
@ -46,12 +46,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::pledge("stdio"));
|
||||
|
||||
if (decode) {
|
||||
auto decoded = decode_base64(StringView(buffer));
|
||||
if (!decoded.has_value()) {
|
||||
warnln("base64: invalid input");
|
||||
return 1;
|
||||
}
|
||||
fwrite(decoded.value().data(), sizeof(u8), decoded.value().size(), stdout);
|
||||
auto decoded = TRY(decode_base64(StringView(buffer)));
|
||||
fwrite(decoded.data(), sizeof(u8), decoded.size(), stdout);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue