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
7cc21d03
Commit
7cc21d03
authored
Feb 19, 2020
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Feb 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Fix wsprintfA %C conversion.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3b5619a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
wsprintf.c
dlls/user32/tests/wsprintf.c
+0
-2
wsprintf.c
dlls/user32/wsprintf.c
+12
-2
No files found.
dlls/user32/tests/wsprintf.c
View file @
7cc21d03
...
...
@@ -111,12 +111,10 @@ static void wsprintfATest(void)
memset
(
buf
,
0x11
,
sizeof
(
buf
));
rc
=
wsprintfA
(
buf
,
testcase
[
i
].
fmt
,
testcase
[
i
].
input
);
todo_wine_if
(
i
==
7
)
ok
(
rc
==
testcase
[
i
].
rc
,
"%u: expected %d, got %d
\n
"
,
i
,
testcase
[
i
].
rc
,
rc
);
todo_wine_if
(
i
==
7
||
i
==
8
||
i
==
9
)
ok
(
!
strcmp
(
buf
,
testcase
[
i
].
str
),
"%u: expected %s, got %s
\n
"
,
i
,
wine_dbgstr_a
(
testcase
[
i
].
str
),
wine_dbgstr_an
(
buf
,
rc
));
...
...
dlls/user32/wsprintf.c
View file @
7cc21d03
...
...
@@ -255,8 +255,11 @@ static UINT WPRINTF_GetLen( WPRINTF_FORMAT *format, WPRINTF_DATA *arg,
switch
(
format
->
type
)
{
case
WPR_CHAR
:
case
WPR_WCHAR
:
return
(
format
->
precision
=
1
);
case
WPR_WCHAR
:
if
(
dst_is_wide
)
len
=
1
;
else
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
&
arg
->
wchar_view
,
1
,
NULL
,
0
,
NULL
,
NULL
);
return
(
format
->
precision
=
len
);
case
WPR_STRING
:
if
(
!
arg
->
lpcstr_view
)
arg
->
lpcstr_view
=
null_stringA
;
if
(
dst_is_wide
)
...
...
@@ -387,7 +390,14 @@ static INT wvsnprintfA( LPSTR buffer, UINT maxlen, LPCSTR spec, __ms_va_list arg
switch
(
format
.
type
)
{
case
WPR_WCHAR
:
*
p
++
=
argData
.
wchar_view
;
{
CHAR
mb
[
5
];
if
(
WideCharToMultiByte
(
CP_ACP
,
0
,
&
argData
.
wchar_view
,
1
,
mb
,
sizeof
(
mb
),
NULL
,
NULL
))
{
memcpy
(
p
,
mb
,
len
);
p
+=
len
;
}
}
break
;
case
WPR_CHAR
:
*
p
++
=
argData
.
char_view
;
...
...
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