Michael Stefaniuc : eject: Use wide-char string literals.
Alexandre Julliard
julliard at winehq.org
Fri Oct 9 16:00:44 CDT 2020
Module: wine
Branch: master
Commit: 17c6e28513afe07f592f9d816faea1369a427c65
URL: https://source.winehq.org/git/wine.git/?a=commit;h=17c6e28513afe07f592f9d816faea1369a427c65
Author: Michael Stefaniuc <mstefani at winehq.org>
Date: Thu Oct 8 23:27:58 2020 +0200
eject: Use wide-char string literals.
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
programs/eject/eject.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/programs/eject/eject.c b/programs/eject/eject.c
index 0a081cfdf5..e6416eacff 100644
--- a/programs/eject/eject.c
+++ b/programs/eject/eject.c
@@ -37,17 +37,15 @@ static BOOL eject_all;
/* wrapper for GetDriveTypeW */
static DWORD get_drive_type( WCHAR drive )
{
- static const WCHAR rootW[] = {'a',':','\\',0};
WCHAR path[16];
- memcpy( path, rootW, sizeof(rootW) );
+ lstrcpyW( path, L"a:\\" );
path[0] = drive;
return GetDriveTypeW( path );
}
static BOOL eject_cd( WCHAR drive )
{
- static const WCHAR deviceW[] = {'\\','\\','.','\\','a',':',0};
PREVENT_MEDIA_REMOVAL removal;
WCHAR buffer[16];
HANDLE handle;
@@ -59,7 +57,7 @@ static BOOL eject_cd( WCHAR drive )
return FALSE;
}
- memcpy( buffer, deviceW, sizeof(deviceW) );
+ lstrcpyW( buffer, L"\\\\.\\a:" );
buffer[4] = drive;
handle = CreateFileW( buffer, 0, FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, 0, 0 );
More information about the wine-cvs
mailing list