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
6f358ef8
Commit
6f358ef8
authored
May 24, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
May 24, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix wcstombs_l implementation.
parent
2ca3b9e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
wcs.c
dlls/msvcrt/wcs.c
+19
-11
No files found.
dlls/msvcrt/wcs.c
View file @
6f358ef8
...
...
@@ -240,26 +240,34 @@ MSVCRT_size_t CDECL MSVCRT__wcstombs_l(char *mbstr, const MSVCRT_wchar_t *wcstr,
MSVCRT_size_t
count
,
MSVCRT__locale_t
locale
)
{
char
default_char
=
'\0'
;
MSVCRT_size_t
tmp
;
MSVCRT_size_t
tmp
=
0
;
BOOL
used_default
;
if
(
!
locale
)
locale
=
get_locale
();
/* FIXME: Use wcslen here */
tmp
=
strlenW
(
wcstr
);
if
(
tmp
>
count
&&
mbstr
)
tmp
=
count
;
if
(
!
mbstr
)
return
WideCharToMultiByte
(
locale
->
locinfo
->
lc_codepage
,
WC_NO_BEST_FIT_CHARS
,
wcstr
,
-
1
,
NULL
,
0
,
&
default_char
,
&
used_default
)
-
1
;
tmp
=
WideCharToMultiByte
(
locale
->
locinfo
->
lc_codepage
,
WC_NO_BEST_FIT_CHARS
,
wcstr
,
tmp
,
mbstr
,
count
,
&
default_char
,
&
used_default
);
while
(
*
wcstr
)
{
char
buf
[
3
];
MSVCRT_size_t
i
,
size
;
if
(
used_default
)
return
-
1
;
size
=
WideCharToMultiByte
(
locale
->
locinfo
->
lc_codepage
,
WC_NO_BEST_FIT_CHARS
,
wcstr
,
1
,
buf
,
3
,
&
default_char
,
&
used_default
);
if
(
used_default
)
return
-
1
;
if
(
tmp
+
size
>
count
)
return
tmp
;
if
(
tmp
<
count
&&
mbstr
)
mbstr
[
tmp
]
=
'\0'
;
for
(
i
=
0
;
i
<
size
;
i
++
)
mbstr
[
tmp
++
]
=
buf
[
i
];
wcstr
++
;
}
if
(
tmp
<
count
)
mbstr
[
tmp
]
=
'\0'
;
return
tmp
;
}
...
...
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