From db693ec7e590138517fe1b1f3ac0e409dbbea211 Mon Sep 17 00:00:00 2001 From: Daniel Gerblick Date: Fri, 15 Jul 2022 15:39:39 -0400 Subject: [PATCH] Fixed SEGFAULT when running hyprctl with only the -j option --- hyprctl/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index 92ab4f5e..b52d6d15 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -232,6 +232,11 @@ int main(int argc, char** argv) { fullRequest += ARGS[i] + " "; } + if (fullRequest.empty()) { + printf("%s\n", USAGE.c_str()); + return 1; + } + fullRequest.pop_back(); // remove trailing space fullRequest = fullArgs + "/" + fullRequest;