From b8de830683da6a42564dcc9df538b53870fac919 Mon Sep 17 00:00:00 2001 From: Kenneth Myhra Date: Sat, 30 Apr 2022 21:50:21 +0200 Subject: [PATCH] base64: Replace char pointer with StringView --- Userland/Utilities/base64.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Userland/Utilities/base64.cpp b/Userland/Utilities/base64.cpp index 5d9047f263..4d21b88199 100644 --- a/Userland/Utilities/base64.cpp +++ b/Userland/Utilities/base64.cpp @@ -9,14 +9,13 @@ #include #include #include -#include ErrorOr serenity_main(Main::Arguments arguments) { TRY(Core::System::pledge("stdio rpath")); bool decode = false; - char const* filepath = nullptr; + StringView filepath = {}; Core::ArgsParser args_parser; args_parser.add_option(decode, "Decode data", "decode", 'd'); @@ -24,7 +23,7 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.parse(arguments); ByteBuffer buffer; - if (filepath == nullptr || strcmp(filepath, "-") == 0) { + if (filepath == nullptr || filepath == "-") { buffer = Core::File::standard_input()->read_all(); } else { auto file = TRY(Core::File::open(filepath, Core::OpenMode::ReadOnly));