From d123835ef538b3bbe3bd15f81513aa7f48871c3b Mon Sep 17 00:00:00 2001 From: eriedaberrie <64395218+eriedaberrie@users.noreply.github.com> Date: Fri, 9 Jun 2023 03:15:18 -0700 Subject: [PATCH] main: fix segfault when -c is given with no other arguments (#2470) --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 9c52e66f..8f25574b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -51,7 +51,7 @@ int main(int argc, char** argv) { ignoreSudo = true; } else if (it->compare("-c") == 0 || it->compare("--config") == 0) { - if (std::next(it)->c_str() == nullptr) { + if (std::next(it) == args.end()) { help(); return 1; }