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
2ca3b9e0
Commit
2ca3b9e0
authored
May 22, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
May 24, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix mbstowcs_l implementation.
parent
7b8243e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
mbcs.c
dlls/msvcrt/mbcs.c
+16
-9
No files found.
dlls/msvcrt/mbcs.c
View file @
2ca3b9e0
...
...
@@ -1725,22 +1725,29 @@ MSVCRT_size_t CDECL _mbstrlen(const char* str)
MSVCRT_size_t
CDECL
MSVCRT__mbstowcs_l
(
MSVCRT_wchar_t
*
wcstr
,
const
char
*
mbstr
,
MSVCRT_size_t
count
,
MSVCRT__locale_t
locale
)
{
MSVCRT_size_t
tmp
;
MSVCRT_size_t
i
,
size
;
if
(
!
locale
)
locale
=
get_locale
();
tmp
=
_mbstrlen_l
(
mbstr
,
locale
);
if
(
tmp
>
count
&&
wcstr
)
tmp
=
count
;
/* Ignore count parameter */
if
(
!
wcstr
)
return
MultiByteToWideChar
(
locale
->
locinfo
->
lc_codepage
,
0
,
mbstr
,
-
1
,
NULL
,
0
)
-
1
;
tmp
=
MultiByteToWideChar
(
locale
->
locinfo
->
lc_codepage
,
0
,
mbstr
,
tmp
,
wcstr
,
count
);
for
(
i
=
0
,
size
=
0
;
i
<
count
;
i
++
)
{
if
(
mbstr
[
size
]
==
'\0'
)
break
;
size
+=
(
MSVCRT_isleadbyte
(
mbstr
[
size
])
?
2
:
1
);
}
size
=
MultiByteToWideChar
(
locale
->
locinfo
->
lc_codepage
,
0
,
mbstr
,
size
,
wcstr
,
count
);
if
(
tmp
<
count
&&
wcstr
)
wcstr
[
tmp
]
=
'\0'
;
if
(
size
<
count
&&
wcstr
)
wcstr
[
size
]
=
'\0'
;
return
tmp
;
return
size
;
}
/*********************************************************************
...
...
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