Skip to content

Commit 8afcf1b

Browse files
committed
dangle me not
1 parent d959609 commit 8afcf1b

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

library/modules/DFSteam.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,13 @@ static bool launchDFHack(color_ostream& out) {
157157
si.cb = sizeof(si);
158158
ZeroMemory(&pi, sizeof(pi));
159159

160-
auto procpath = Core.getInstance().getHackPath() / "launchdf.exe";
161-
LPCWSTR procname = procpath.wstring().c_str();
160+
auto procpath = Core::getInstance().getHackPath() / "launchdf.exe";
162161
static const char * env = "\0";
163162

164163
// note that the environment must be explicitly zeroed out and not NULL,
165164
// otherwise the launched process will inherit this process's environment,
166165
// and the Steam API in the launchdf process will think it is in DF's context.
167-
BOOL res = CreateProcessW(procname,
166+
BOOL res = CreateProcessW(procpath.wstring().c_str(),
168167
NULL, NULL, NULL, FALSE, 0, (LPVOID)env, NULL, &si, &pi);
169168

170169
return !!res;
@@ -210,9 +209,9 @@ static bool launchDFHack(color_ostream& out) {
210209
} else if (pid == 0) {
211210
// child process
212211
auto procpath = Core::getInstance().getHackPath() / "launchdf.exe";
213-
char * command = procpath.string().c_str();
212+
auto command = procpath.string();
214213
unsetenv("SteamAppId");
215-
execl(command, command, NULL);
214+
execl(command.c_str(), command.c_str(), NULL);
216215
_exit(EXIT_FAILURE);
217216
}
218217

0 commit comments

Comments
 (0)