diff options
| author | bazuin-32 <ameenpiano@gmail.com> | 2022-07-12 15:38:50 -0600 |
|---|---|---|
| committer | bazuin-32 <ameenpiano@gmail.com> | 2022-07-12 15:38:50 -0600 |
| commit | ac9ff795cdfd25c37b9b9be44f3d034bfa3284d3 (patch) | |
| tree | e7807a49dc48463205d4415c7133ef4b386e495c /src/debug | |
| parent | 4bea3467e03eae7c3db251b84605345c576c4313 (diff) | |
Fix calls to `substr` with invalid `pos`
Diffstat (limited to 'src/debug')
| -rw-r--r-- | src/debug/HyprCtl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 76fe3c56..684bca9c 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -526,7 +526,8 @@ std::string getReply(std::string request) { format = HyprCtl::FORMAT_JSON; } - request = request.substr(sepIndex + 1); // remove flags and separator so we can compare the rest of the string + if (sepIndex < request.size()) + request = request.substr(sepIndex + 1); // remove flags and separator so we can compare the rest of the string if (request == "monitors") return monitorsRequest(format); |
