From 45fc5cdffa7c7fd9255880f9b24cd95dd1423b67 Mon Sep 17 00:00:00 2001 From: hasherezade Date: Fri, 24 Jan 2025 04:33:53 -0800 Subject: [PATCH] [REFACT] Fixed check if substring not found --- etw_listener.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etw_listener.cpp b/etw_listener.cpp index 687463f..2434167 100644 --- a/etw_listener.cpp +++ b/etw_listener.cpp @@ -170,7 +170,7 @@ inline std::wstring getProcessName(const DWORD pid) std::wstring pName(processName); std::transform(pName.begin(), pName.end(), pName.begin(), tolower); std::size_t found = pName.find_last_of(L"/\\"); - if (found == (-1) || found >= pName.length()) { + if (found == std::wstring::npos || found >= pName.length()) { return pName; } return pName.substr(found + 1);