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
e98dbf2e
Commit
e98dbf2e
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 wsprintfW %C conversion.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
20ff7ad9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
wsprintf.c
dlls/user32/tests/wsprintf.c
+3
-3
wsprintf.c
dlls/user32/wsprintf.c
+9
-2
No files found.
dlls/user32/tests/wsprintf.c
View file @
e98dbf2e
...
@@ -187,17 +187,17 @@ static void wsprintfWTest(void)
...
@@ -187,17 +187,17 @@ static void wsprintfWTest(void)
wcA1
=
my_btowc
(
0xA1
);
wcA1
=
my_btowc
(
0xA1
);
rc
=
wsprintfW
(
buf
,
L"%C"
,
0xA1
);
rc
=
wsprintfW
(
buf
,
L"%C"
,
0xA1
);
ok
(
rc
==
1
,
"expected 1, got %d
\n
"
,
rc
);
ok
(
rc
==
1
,
"expected 1, got %d
\n
"
,
rc
);
todo_wine
ok
(
buf
[
0
]
==
wcA1
,
"expected
\\
x%04x, got
\\
x%04x
\n
"
,
wcA1
,
buf
[
0
]);
ok
(
buf
[
0
]
==
wcA1
,
"expected
\\
x%04x, got
\\
x%04x
\n
"
,
wcA1
,
buf
[
0
]);
rc
=
wsprintfW
(
buf
,
L"%C"
,
0x81A1
);
rc
=
wsprintfW
(
buf
,
L"%C"
,
0x81A1
);
ok
(
rc
==
1
,
"expected 1, got %d
\n
"
,
rc
);
ok
(
rc
==
1
,
"expected 1, got %d
\n
"
,
rc
);
todo_wine
ok
(
buf
[
0
]
==
wcA1
,
"expected
\\
x%04x, got
\\
x%04x
\n
"
,
wcA1
,
buf
[
0
]);
ok
(
buf
[
0
]
==
wcA1
,
"expected
\\
x%04x, got
\\
x%04x
\n
"
,
wcA1
,
buf
[
0
]);
wc99
=
my_btowc
(
0x99
);
wc99
=
my_btowc
(
0x99
);
rc
=
wsprintfW
(
buf
,
L"%2C"
,
0xe199
);
rc
=
wsprintfW
(
buf
,
L"%2C"
,
0xe199
);
ok
(
rc
==
2
,
"expected 1, got %d
\n
"
,
rc
);
ok
(
rc
==
2
,
"expected 1, got %d
\n
"
,
rc
);
ok
(
buf
[
0
]
==
L' '
,
"expected
\\
x0020, got
\\
x%04x
\n
"
,
buf
[
0
]);
ok
(
buf
[
0
]
==
L' '
,
"expected
\\
x0020, got
\\
x%04x
\n
"
,
buf
[
0
]);
todo_wine
ok
(
buf
[
1
]
==
wc99
,
"expected
\\
x%04x, got
\\
x%04x
\n
"
,
wc99
,
buf
[
1
]);
ok
(
buf
[
1
]
==
wc99
,
"expected
\\
x%04x, got
\\
x%04x
\n
"
,
wc99
,
buf
[
1
]);
if
(
!
GetCPInfoExW
(
CP_ACP
,
0
,
&
cpinfoex
)
||
cpinfoex
.
MaxCharSize
<=
1
)
if
(
!
GetCPInfoExW
(
CP_ACP
,
0
,
&
cpinfoex
)
||
cpinfoex
.
MaxCharSize
<=
1
)
{
{
...
...
dlls/user32/wsprintf.c
View file @
e98dbf2e
...
@@ -513,8 +513,15 @@ static INT wvsnprintfW( LPWSTR buffer, UINT maxlen, LPCWSTR spec, __ms_va_list a
...
@@ -513,8 +513,15 @@ static INT wvsnprintfW( LPWSTR buffer, UINT maxlen, LPCWSTR spec, __ms_va_list a
*
p
++
=
argData
.
wchar_view
;
*
p
++
=
argData
.
wchar_view
;
break
;
break
;
case
WPR_CHAR
:
case
WPR_CHAR
:
*
p
++
=
argData
.
char_view
;
{
break
;
WCHAR
wc
;
if
(
!
IsDBCSLeadByte
(
(
BYTE
)
argData
.
char_view
)
&&
MultiByteToWideChar
(
CP_ACP
,
0
,
&
argData
.
char_view
,
1
,
&
wc
,
1
)
>
0
)
*
p
++
=
wc
;
else
*
p
++
=
0
;
break
;
}
case
WPR_STRING
:
case
WPR_STRING
:
{
{
LPCSTR
ptr
=
argData
.
lpcstr_view
;
LPCSTR
ptr
=
argData
.
lpcstr_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