Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
4f5a6841
Commit
4f5a6841
authored
May 16, 2016
by
Piotr Caban
Committed by
Alexandre Julliard
May 16, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix mbsrtowcs behavior when no out buffer is passed.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1b072058
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
mbcs.c
dlls/msvcrt/mbcs.c
+6
-3
No files found.
dlls/msvcrt/mbcs.c
View file @
4f5a6841
...
...
@@ -2344,26 +2344,29 @@ MSVCRT_size_t CDECL MSVCRT_mbsrtowcs(MSVCRT_wchar_t *wcstr,
MSVCRT_mbstate_t
s
=
(
state
?
*
state
:
0
);
MSVCRT_wchar_t
tmpdst
;
MSVCRT_size_t
ret
=
0
;
const
char
*
p
;
if
(
!
MSVCRT_CHECK_PMT
(
pmbstr
!=
NULL
))
return
-
1
;
p
=
*
pmbstr
;
while
(
!
wcstr
||
count
>
ret
)
{
int
ch_len
=
MSVCRT_mbrtowc
(
&
tmpdst
,
*
pmbstr
,
2
,
&
s
);
int
ch_len
=
MSVCRT_mbrtowc
(
&
tmpdst
,
p
,
2
,
&
s
);
if
(
wcstr
)
wcstr
[
ret
]
=
tmpdst
;
if
(
ch_len
<
0
)
{
return
-
1
;
}
else
if
(
ch_len
==
0
)
{
*
pmbstr
=
NULL
;
if
(
wcstr
)
*
pmbstr
=
NULL
;
return
ret
;
}
*
pmbstr
+=
ch_len
;
p
+=
ch_len
;
ret
++
;
}
if
(
wcstr
)
*
pmbstr
=
p
;
return
ret
;
}
...
...
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