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
13aff6dc
Commit
13aff6dc
authored
Nov 30, 2011
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Dec 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix wctob in C locale.
parent
f9403bfb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
string.c
dlls/msvcrt/tests/string.c
+3
-0
wcs.c
dlls/msvcrt/wcs.c
+7
-1
No files found.
dlls/msvcrt/tests/string.c
View file @
13aff6dc
...
@@ -2002,6 +2002,9 @@ static void test_wctob(void)
...
@@ -2002,6 +2002,9 @@ static void test_wctob(void)
ret
=
p_wctob
(
0x81
);
ret
=
p_wctob
(
0x81
);
ok
(
ret
==
(
int
)(
char
)
0x81
,
"ret = %x
\n
"
,
ret
);
ok
(
ret
==
(
int
)(
char
)
0x81
,
"ret = %x
\n
"
,
ret
);
ret
=
p_wctob
(
0x9f
);
ok
(
ret
==
(
int
)(
char
)
0x9f
,
"ret = %x
\n
"
,
ret
);
ret
=
p_wctob
(
0xe0
);
ret
=
p_wctob
(
0xe0
);
ok
(
ret
==
(
int
)(
char
)
0xe0
,
"ret = %x
\n
"
,
ret
);
ok
(
ret
==
(
int
)(
char
)
0xe0
,
"ret = %x
\n
"
,
ret
);
}
}
...
...
dlls/msvcrt/wcs.c
View file @
13aff6dc
...
@@ -1056,8 +1056,14 @@ INT CDECL MSVCRT_wctob( MSVCRT_wint_t wchar )
...
@@ -1056,8 +1056,14 @@ INT CDECL MSVCRT_wctob( MSVCRT_wint_t wchar )
{
{
char
out
;
char
out
;
BOOL
error
;
BOOL
error
;
UINT
codepage
=
get_locinfo
()
->
lc_codepage
;
if
(
WideCharToMultiByte
(
get_locinfo
()
->
lc_codepage
,
0
,
&
wchar
,
1
,
&
out
,
1
,
NULL
,
&
error
)
&&
!
error
)
if
(
!
codepage
)
{
if
(
wchar
<
0xff
)
return
(
signed
char
)
wchar
;
else
return
MSVCRT_EOF
;
}
else
if
(
WideCharToMultiByte
(
codepage
,
0
,
&
wchar
,
1
,
&
out
,
1
,
NULL
,
&
error
)
&&
!
error
)
return
(
INT
)
out
;
return
(
INT
)
out
;
return
MSVCRT_EOF
;
return
MSVCRT_EOF
;
}
}
...
...
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