Skip to content

Commit 291c755

Browse files
woops. forgot i made a revert
1 parent 954b45b commit 291c755

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

steam_helper/steam.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
* Windows version of Steam running. */
3434

3535
#include <windows.h>
36+
#include <string.h>
37+
#include <stdio.h>
3638

3739
#pragma push_macro("_WIN32")
3840
#pragma push_macro("__cdecl")
@@ -42,7 +44,6 @@
4244
#pragma pop_macro("_WIN32")
4345
#pragma pop_macro("__cdecl")
4446

45-
#include "wine/unicode.h"
4647
#include "wine/debug.h"
4748

4849
WINE_DEFAULT_DEBUG_CHANNEL(steam);
@@ -118,7 +119,7 @@ static void setup_steam_registry(void)
118119

119120
static WCHAR *find_quote(WCHAR *str)
120121
{
121-
WCHAR *end = strchrW(str, '"'), *ch;
122+
WCHAR *end = wcschr(str, '"'), *ch;
122123
int odd;
123124
while (end)
124125
{
@@ -131,7 +132,7 @@ static WCHAR *find_quote(WCHAR *str)
131132
}
132133
if (!odd)
133134
return end;
134-
end = strchrW(end + 1, '"');
135+
end = wcschr(end + 1, '"');
135136
}
136137
return NULL;
137138
}
@@ -156,7 +157,7 @@ static HANDLE run_process(void)
156157
}
157158
else
158159
{
159-
cmdline = strchrW(cmdline, ' ');
160+
cmdline = wcschr(cmdline, ' ');
160161
}
161162
if (!cmdline)
162163
{
@@ -195,9 +196,9 @@ static HANDLE run_process(void)
195196
else
196197
{
197198
start = cmdline;
198-
end = strchrW(start, ' ');
199+
end = wcschr(start, ' ');
199200
if (!end)
200-
end = strchrW(start, '\0');
201+
end = wcschr(start, '\0');
201202
remainder = end;
202203
}
203204

@@ -234,11 +235,11 @@ static HANDLE run_process(void)
234235
flags |= CREATE_NEW_CONSOLE;
235236

236237
new_cmdline = (WCHAR *)HeapAlloc(GetProcessHeap(), 0,
237-
(strlenW(dos) + 3 + strlenW(remainder) + 1) * sizeof(WCHAR));
238-
strcpyW(new_cmdline, dquoteW);
239-
strcatW(new_cmdline, dos);
240-
strcatW(new_cmdline, dquoteW);
241-
strcatW(new_cmdline, remainder);
238+
(lstrlenW(dos) + 3 + lstrlenW(remainder) + 1) * sizeof(WCHAR));
239+
lstrcpyW(new_cmdline, dquoteW);
240+
lstrcatW(new_cmdline, dos);
241+
lstrcatW(new_cmdline, dquoteW);
242+
lstrcatW(new_cmdline, remainder);
242243

243244
cmdline = new_cmdline;
244245
}

0 commit comments

Comments
 (0)