Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
0df592b7
Commit
0df592b7
authored
Oct 05, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Oct 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hostname: Use wide-char string literals.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
69dd2752
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
hostname.c
programs/hostname/hostname.c
+3
-8
No files found.
programs/hostname/hostname.c
View file @
0df592b7
...
...
@@ -91,18 +91,15 @@ static int WINAPIV hostname_message_printfW(int msg, ...)
static
int
hostname_message
(
int
msg
)
{
static
const
WCHAR
formatW
[]
=
{
'%'
,
's'
,
0
};
WCHAR
msg_buffer
[
8192
];
LoadStringW
(
GetModuleHandleW
(
NULL
),
msg
,
msg_buffer
,
ARRAY_SIZE
(
msg_buffer
));
return
hostname_printfW
(
formatW
,
msg_buffer
);
return
hostname_printfW
(
L"%s"
,
msg_buffer
);
}
static
int
display_computer_name
(
void
)
{
static
const
WCHAR
fmtW
[]
=
{
'%'
,
's'
,
'\r'
,
'\n'
,
0
};
WCHAR
name
[
MAX_COMPUTERNAME_LENGTH
+
1
];
DWORD
size
=
ARRAY_SIZE
(
name
);
BOOL
ret
;
...
...
@@ -114,7 +111,7 @@ static int display_computer_name(void)
return
1
;
}
hostname_printfW
(
fmtW
,
name
);
hostname_printfW
(
L"%s
\r\n
"
,
name
);
return
0
;
}
...
...
@@ -122,11 +119,9 @@ int __cdecl wmain(int argc, WCHAR *argv[])
{
if
(
argc
>
1
)
{
static
const
WCHAR
slashHelpW
[]
=
{
'/'
,
'?'
,
0
};
unsigned
int
i
;
if
(
!
wcsncmp
(
argv
[
1
],
slashHelpW
,
ARRAY_SIZE
(
slashHelpW
)
-
1
))
if
(
!
wcsncmp
(
argv
[
1
],
L"/?"
,
ARRAY_SIZE
(
L"/?"
)
-
1
))
{
hostname_message
(
STRING_USAGE
);
return
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment