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
6f8ae18c
Commit
6f8ae18c
authored
Feb 09, 2020
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Feb 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Fix wnsprintfW/wvnsprintfW %S conversion.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fa8a9a81
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
3 deletions
+24
-3
wsprintf.c
dlls/shlwapi/wsprintf.c
+24
-3
No files found.
dlls/shlwapi/wsprintf.c
View file @
6f8ae18c
...
...
@@ -258,8 +258,22 @@ static UINT WPRINTF_GetLen( WPRINTF_FORMAT *format, WPRINTF_DATA *arg,
return
(
format
->
precision
=
1
);
case
WPR_STRING
:
if
(
!
arg
->
lpcstr_view
)
arg
->
lpcstr_view
=
null_stringA
;
for
(
len
=
0
;
!
format
->
precision
||
(
len
<
format
->
precision
);
len
++
)
if
(
!*
(
arg
->
lpcstr_view
+
len
))
break
;
if
(
dst_is_wide
)
{
LPCSTR
p
=
arg
->
lpcstr_view
;
for
(
len
=
0
;
(
!
format
->
precision
||
len
<
format
->
precision
)
&&
*
p
;
p
++
)
{
/* This isn't applicable for UTF-8 and UTF-7 */
if
(
IsDBCSLeadByte
(
*
p
))
p
++
;
len
++
;
if
(
!*
p
)
break
;
}
}
else
{
for
(
len
=
0
;
!
format
->
precision
||
(
len
<
format
->
precision
);
len
++
)
if
(
!*
(
arg
->
lpcstr_view
+
len
))
break
;
}
if
(
len
>
maxlen
)
len
=
maxlen
;
return
(
format
->
precision
=
len
);
case
WPR_WSTRING
:
...
...
@@ -506,7 +520,14 @@ INT WINAPI wvnsprintfW( LPWSTR buffer, INT maxlen, LPCWSTR spec, __ms_va_list ar
case
WPR_STRING
:
{
LPCSTR
ptr
=
argData
.
lpcstr_view
;
for
(
i
=
0
;
i
<
len
;
i
++
)
*
p
++
=
(
BYTE
)
*
ptr
++
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
WCHAR
buf
[
2
];
/* for LeadByte + NUL case, we need 2 WCHARs. */
int
ret
,
mb_len
=
IsDBCSLeadByte
(
*
ptr
)
?
2
:
1
;
ret
=
MultiByteToWideChar
(
CP_ACP
,
0
,
ptr
,
mb_len
,
buf
,
ARRAY_SIZE
(
buf
));
*
p
++
=
buf
[
ret
-
1
];
ptr
+=
mb_len
;
}
}
break
;
case
WPR_WSTRING
:
...
...
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