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
a36b5f07
Commit
a36b5f07
authored
May 06, 2016
by
Piotr Caban
Committed by
Alexandre Julliard
May 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix mbtowc behavior for buffers containing more than one character.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8fb1802b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
mbcs.c
dlls/msvcrt/mbcs.c
+17
-9
No files found.
dlls/msvcrt/mbcs.c
View file @
a36b5f07
...
...
@@ -2157,17 +2157,25 @@ int CDECL MSVCRT_mbtowc_l(MSVCRT_wchar_t *dst, const char* str, MSVCRT_size_t n,
if
(
n
<=
0
||
!
str
)
return
0
;
if
(
!
locinfo
->
lc_codepage
)
tmpdst
=
(
unsigned
char
)
*
str
;
else
if
(
!
MultiByteToWideChar
(
locinfo
->
lc_codepage
,
0
,
str
,
n
,
&
tmpdst
,
1
))
return
-
1
;
if
(
dst
)
*
dst
=
tmpdst
;
/* return the number of bytes from src that have been used */
if
(
!*
str
)
if
(
!*
str
)
{
if
(
dst
)
*
dst
=
0
;
return
0
;
if
(
n
>=
2
&&
MSVCRT__isleadbyte_l
((
unsigned
char
)
*
str
,
locale
)
&&
str
[
1
])
}
if
(
!
locinfo
->
lc_codepage
)
{
if
(
dst
)
*
dst
=
(
unsigned
char
)
*
str
;
return
1
;
}
if
(
n
>=
2
&&
MSVCRT__isleadbyte_l
((
unsigned
char
)
*
str
,
locale
))
{
if
(
!
MultiByteToWideChar
(
locinfo
->
lc_codepage
,
0
,
str
,
2
,
&
tmpdst
,
1
))
return
-
1
;
if
(
dst
)
*
dst
=
tmpdst
;
return
2
;
}
if
(
!
MultiByteToWideChar
(
locinfo
->
lc_codepage
,
0
,
str
,
1
,
&
tmpdst
,
1
))
return
-
1
;
if
(
dst
)
*
dst
=
tmpdst
;
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