- Fix silly bug in last commit, remove the .exe name from the path.

This commit is contained in:
basil00
2014-09-05 12:27:25 +08:00
parent 7bd52aed76
commit 6b3fd714c0
+3 -1
View File
@@ -321,7 +321,9 @@ static BOOLEAN WinDivertGetDriverFileName(LPWSTR sys_str)
{
return FALSE;
}
if (dir_len + sys_len + 1 >= MAX_PATH)
for (; dir_len > 0 && sys_str[dir_len] != L'\\'; dir_len--)
;
if (sys_str[dir_len] != L'\\' || dir_len + sys_len + 1 >= MAX_PATH)
{
SetLastError(ERROR_BAD_PATHNAME);
return FALSE;