Fix calls to substr with invalid pos

This commit is contained in:
bazuin-32 2022-07-12 15:38:50 -06:00
parent 4bea3467e0
commit ac9ff795cd

View file

@ -526,6 +526,7 @@ std::string getReply(std::string request) {
format = HyprCtl::FORMAT_JSON; format = HyprCtl::FORMAT_JSON;
} }
if (sepIndex < request.size())
request = request.substr(sepIndex + 1); // remove flags and separator so we can compare the rest of the string request = request.substr(sepIndex + 1); // remove flags and separator so we can compare the rest of the string
if (request == "monitors") if (request == "monitors")