summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
authorKenneth Myhra <kennethmyhra@gmail.com>2022-04-30 21:50:21 +0200
committerLinus Groh <mail@linusgroh.de>2022-05-02 22:18:27 +0200
commitb8de830683da6a42564dcc9df538b53870fac919 (patch)
treeac1f666067fb9a334d233ad8338ca243f2cbd8ef /Userland/Utilities
parentbd81e15bc931be5422aabc32fd8eed0570b17352 (diff)
downloadserenity-b8de830683da6a42564dcc9df538b53870fac919.zip
base64: Replace char pointer with StringView
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/base64.cpp5
1 files 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 <LibCore/File.h>
#include <LibCore/System.h>
#include <LibMain/Main.h>
-#include <string.h>
ErrorOr<int> 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<int> 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));