Michael Stefaniuc : regsvr32: Use wide-char string literals.

Alexandre Julliard julliard at winehq.org
Thu Oct 8 15:20:05 CDT 2020


Module: wine
Branch: master
Commit: dea850cfd5387d9b2fffacb40544ae38296cba72
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=dea850cfd5387d9b2fffacb40544ae38296cba72

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Thu Oct  8 12:16:09 2020 +0200

regsvr32: Use wide-char string literals.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/regsvr32/regsvr32.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/programs/regsvr32/regsvr32.c b/programs/regsvr32/regsvr32.c
index 730f1fef3d..885f0ff783 100644
--- a/programs/regsvr32/regsvr32.c
+++ b/programs/regsvr32/regsvr32.c
@@ -114,9 +114,7 @@ static LPCWSTR find_arg_start(LPCWSTR cmdline)
 static void reexec_self(void)
 {
     /* restart current process as 32-bit or 64-bit with same command line */
-    static const WCHAR exe_name[] = {'\\','r','e','g','s','v','r','3','2','.','e','x','e',0};
 #ifndef _WIN64
-    static const WCHAR sysnative[] = {'\\','S','y','s','N','a','t','i','v','e',0};
     BOOL wow64;
 #endif
     WCHAR systemdir[MAX_PATH];
@@ -138,16 +136,16 @@ static void reexec_self(void)
     }
 
     GetWindowsDirectoryW(systemdir, MAX_PATH);
-    wcscat(systemdir, sysnative);
+    wcscat(systemdir, L"\\SysNative");
 #endif
 
     args = find_arg_start(GetCommandLineW());
 
     cmdline = HeapAlloc(GetProcessHeap(), 0,
-        (wcslen(systemdir)+wcslen(exe_name)+wcslen(args)+1)*sizeof(WCHAR));
+        (wcslen(systemdir)+wcslen(L"\\regsvr32.exe")+wcslen(args)+1)*sizeof(WCHAR));
 
     wcscpy(cmdline, systemdir);
-    wcscat(cmdline, exe_name);
+    wcscat(cmdline, L"\\regsvr32.exe");
     wcscat(cmdline, args);
 
     si.cb = sizeof(si);




More information about the wine-cvs mailing list