diff --git a/src/clientaccess_linux.cpp b/src/clientaccess_linux.cpp index ff540ba..b54a101 100644 --- a/src/clientaccess_linux.cpp +++ b/src/clientaccess_linux.cpp @@ -24,7 +24,7 @@ static const std::string CLIENTNAME = "LeagueClientUx.exe"; // returns the name static std::shared_ptr findUsingLockfile(const std::vector& cmdline, pid_t pid); static bool endsWith(const std::string& all, const std::string& end) { - return all.rfind(end) == all.size() - end.size(); + return all.size() >= end.size() && all.rfind(end) == all.size() - end.size(); } // reads a procfile into a vector (strings are \0 seperated) @@ -71,7 +71,7 @@ std::shared_ptr ClientAccess::find() { std::string& exename = args.at(0); if(endsWith(exename, CLIENTNAME)) { - Log::info << CLIENTNAME << " found"; + Log::info << CLIENTNAME << " found: " << exename; std::shared_ptr out;