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
7d77d77d
Commit
7d77d77d
authored
Apr 17, 2003
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Apr 17, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mbtowc returns -1 if we can't find a valid multibyte char in the non
NULL source string.
parent
6a7d463c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
mbcs.c
dlls/msvcrt/mbcs.c
+15
-10
No files found.
dlls/msvcrt/mbcs.c
View file @
7d77d77d
...
...
@@ -588,16 +588,21 @@ unsigned char* _mbstok(unsigned char *str, const unsigned char *delim)
*/
int
MSVCRT_mbtowc
(
MSVCRT_wchar_t
*
dst
,
const
char
*
str
,
MSVCRT_size_t
n
)
{
if
(
n
<=
0
||
!
str
)
return
0
;
if
(
!
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
n
,
dst
,
1
))
return
0
;
/* return the number of bytes from src that have been used */
if
(
!*
str
)
return
0
;
if
(
n
>=
2
&&
MSVCRT_isleadbyte
(
*
str
)
&&
str
[
1
])
return
2
;
return
1
;
/* temp var needed because MultiByteToWideChar wants non NULL destination */
MSVCRT_wchar_t
tmpdst
=
'\0'
;
if
(
n
<=
0
||
!
str
)
return
0
;
if
(
!
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
n
,
&
tmpdst
,
1
))
return
-
1
;
if
(
dst
)
*
dst
=
tmpdst
;
/* return the number of bytes from src that have been used */
if
(
!*
str
)
return
0
;
if
(
n
>=
2
&&
MSVCRT_isleadbyte
(
*
str
)
&&
str
[
1
])
return
2
;
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