Use nssm_imagepath().
[nssm.git] / env.cpp
diff --git a/env.cpp b/env.cpp
index 9945d20..083f46a 100644 (file)
--- a/env.cpp
+++ b/env.cpp
@@ -129,8 +129,7 @@ int duplicate_environment(TCHAR *rawenv) {
            -1 on error.
 */
 int test_environment(TCHAR *env) {
-  TCHAR path[PATH_LENGTH];
-  GetModuleFileName(0, path, _countof(path));
+  TCHAR *path = (TCHAR *) nssm_imagepath();
   STARTUPINFO si;
   ZeroMemory(&si, sizeof(si));
   si.cb = sizeof(si);