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
b3b498b5
Commit
b3b498b5
authored
Apr 10, 2013
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
icinfo: Fix vsnprintfW usage.
parent
71377c56
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
icinfo.c
programs/icinfo/icinfo.c
+4
-11
No files found.
programs/icinfo/icinfo.c
View file @
b3b498b5
...
...
@@ -29,33 +29,26 @@ static int mywprintf(const WCHAR *format, ...)
static
WCHAR
output_bufW
[
sizeof
(
output_bufA
)
/
sizeof
(
WCHAR
)];
va_list
parms
;
DWORD
nOut
;
int
len
;
BOOL
res
=
FALSE
;
HANDLE
hout
=
GetStdHandle
(
STD_OUTPUT_HANDLE
);
va_start
(
parms
,
format
);
len
=
vsnprintfW
(
output_bufW
,
sizeof
(
output_bufW
),
format
,
parms
);
vsnprintfW
(
output_bufW
,
sizeof
(
output_bufW
),
format
,
parms
);
va_end
(
parms
);
if
(
len
<
0
)
{
/* String too long */
return
0
;
}
/* Try to write as unicode whenever we think it's a console */
if
(((
DWORD_PTR
)
hout
&
3
)
==
3
)
{
res
=
WriteConsoleW
(
hout
,
output_bufW
,
len
,
&
nOut
,
NULL
);
res
=
WriteConsoleW
(
hout
,
output_bufW
,
strlenW
(
output_bufW
)
,
&
nOut
,
NULL
);
}
else
{
BOOL
usedDefaultChar
=
FALSE
;
DWORD
convertedChars
;
/* Convert to OEM, then output */
convertedChars
=
WideCharToMultiByte
(
GetConsoleOutputCP
(),
0
,
output_bufW
,
len
,
convertedChars
=
WideCharToMultiByte
(
GetConsoleOutputCP
(),
0
,
output_bufW
,
-
1
,
output_bufA
,
sizeof
(
output_bufA
),
"?"
,
&
usedDefaultChar
);
NULL
,
NULL
);
res
=
WriteFile
(
hout
,
output_bufA
,
convertedChars
,
&
nOut
,
FALSE
);
}
...
...
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