Skip to content

Commit

Permalink
woops. forgot i made a revert
Browse files Browse the repository at this point in the history
  • Loading branch information
GloriousEggroll committed Feb 17, 2020
1 parent 954b45b commit 291c755
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions steam_helper/steam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* Windows version of Steam running. */

#include <windows.h>
#include <string.h>
#include <stdio.h>

#pragma push_macro("_WIN32")
#pragma push_macro("__cdecl")
Expand All @@ -42,7 +44,6 @@
#pragma pop_macro("_WIN32")
#pragma pop_macro("__cdecl")

#include "wine/unicode.h"
#include "wine/debug.h"

WINE_DEFAULT_DEBUG_CHANNEL(steam);
Expand Down Expand Up @@ -118,7 +119,7 @@ static void setup_steam_registry(void)

static WCHAR *find_quote(WCHAR *str)
{
WCHAR *end = strchrW(str, '"'), *ch;
WCHAR *end = wcschr(str, '"'), *ch;
int odd;
while (end)
{
Expand All @@ -131,7 +132,7 @@ static WCHAR *find_quote(WCHAR *str)
}
if (!odd)
return end;
end = strchrW(end + 1, '"');
end = wcschr(end + 1, '"');
}
return NULL;
}
Expand All @@ -156,7 +157,7 @@ static HANDLE run_process(void)
}
else
{
cmdline = strchrW(cmdline, ' ');
cmdline = wcschr(cmdline, ' ');
}
if (!cmdline)
{
Expand Down Expand Up @@ -195,9 +196,9 @@ static HANDLE run_process(void)
else
{
start = cmdline;
end = strchrW(start, ' ');
end = wcschr(start, ' ');
if (!end)
end = strchrW(start, '\0');
end = wcschr(start, '\0');
remainder = end;
}

Expand Down Expand Up @@ -234,11 +235,11 @@ static HANDLE run_process(void)
flags |= CREATE_NEW_CONSOLE;

new_cmdline = (WCHAR *)HeapAlloc(GetProcessHeap(), 0,
(strlenW(dos) + 3 + strlenW(remainder) + 1) * sizeof(WCHAR));
strcpyW(new_cmdline, dquoteW);
strcatW(new_cmdline, dos);
strcatW(new_cmdline, dquoteW);
strcatW(new_cmdline, remainder);
(lstrlenW(dos) + 3 + lstrlenW(remainder) + 1) * sizeof(WCHAR));
lstrcpyW(new_cmdline, dquoteW);
lstrcatW(new_cmdline, dos);
lstrcatW(new_cmdline, dquoteW);
lstrcatW(new_cmdline, remainder);

cmdline = new_cmdline;
}
Expand Down

0 comments on commit 291c755

Please sign in to comment.