From 61995e3b4ef526274519528278fd62089240e3fc Mon Sep 17 00:00:00 2001 From: vaxerski Date: Fri, 11 Nov 2022 14:04:35 +0000 Subject: [PATCH] guard empty str in isNumber --- hyprctl/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index 49327b75..516a3080 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -251,6 +251,8 @@ std::deque splitArgs(int argc, char** argv) { } bool isNumber(const std::string& str, bool allowfloat) { + if (str.empty()) + return false; return std::ranges::all_of(str.begin(), str.end(), [&](char c) { return isdigit(c) != 0 || c == '-' || (allowfloat && c == '.'); }); }