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
6938fec4
Commit
6938fec4
authored
May 15, 2016
by
Akihiro Sagawa
Committed by
Alexandre Julliard
May 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libport: Fix null character handling when mapping DBCS characters.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cfe015a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
codepage.c
dlls/kernel32/tests/codepage.c
+4
-4
mbtowc.c
libs/port/mbtowc.c
+4
-4
No files found.
dlls/kernel32/tests/codepage.c
View file @
6938fec4
...
...
@@ -1211,9 +1211,9 @@ static void test_dbcs_to_widechar(void)
{
WCHAR
wbuf_ok
[]
=
{
0x770b
,
0x003f
,
'\0'
,
0xffff
};
WCHAR
wbuf_broken
[]
=
{
0x770b
,
'\0'
,
0xffff
,
0xffff
};
todo_wine
ok
(
count
==
3
||
broken
(
count
==
2
/*windows xp*/
),
ok
(
count
==
3
||
broken
(
count
==
2
/*windows xp*/
),
"%04x: returned %d (expected 3)
\n
"
,
flags
[
i
],
count
);
todo_wine
ok
(
!
memcmp
(
wbuf
,
wbuf_ok
,
sizeof
(
wbuf_ok
))
ok
(
!
memcmp
(
wbuf
,
wbuf_ok
,
sizeof
(
wbuf_ok
))
||
broken
(
!
memcmp
(
wbuf
,
wbuf_broken
,
sizeof
(
wbuf_broken
))),
"%04x: returned %04x %04x %04x %04x (expected %04x %04x %04x %04x)
\n
"
,
flags
[
i
],
wbuf
[
0
],
wbuf
[
1
],
wbuf
[
2
],
wbuf
[
3
],
...
...
@@ -1240,9 +1240,9 @@ static void test_dbcs_to_widechar(void)
{
WCHAR
wbuf_ok
[]
=
{
0x770b
,
0x003f
,
'\0'
,
'x'
,
0xffff
};
WCHAR
wbuf_broken
[]
=
{
0x770b
,
'\0'
,
'x'
,
0xffff
,
0xffff
};
todo_wine
ok
(
count
==
4
||
broken
(
count
==
3
),
ok
(
count
==
4
||
broken
(
count
==
3
),
"%04x: returned %d (expected 4)
\n
"
,
flags
[
i
],
count
);
todo_wine
ok
(
!
memcmp
(
wbuf
,
wbuf_ok
,
sizeof
(
wbuf_ok
))
ok
(
!
memcmp
(
wbuf
,
wbuf_ok
,
sizeof
(
wbuf_ok
))
||
broken
(
!
memcmp
(
wbuf
,
wbuf_broken
,
sizeof
(
wbuf_broken
))),
"%04x: returned %04x %04x %04x %04x %04x (expected %04x %04x %04x %04x %04x)
\n
"
,
flags
[
i
],
wbuf
[
0
],
wbuf
[
1
],
wbuf
[
2
],
wbuf
[
3
],
wbuf
[
4
],
...
...
libs/port/mbtowc.c
View file @
6938fec4
...
...
@@ -131,7 +131,7 @@ static inline int get_length_dbcs( const struct dbcs_table *table,
for
(
len
=
0
;
srclen
;
srclen
--
,
src
++
,
len
++
)
{
if
(
cp2uni_lb
[
*
src
]
&&
srclen
>
1
)
if
(
cp2uni_lb
[
*
src
]
&&
srclen
>
1
&&
src
[
1
]
)
{
src
++
;
srclen
--
;
...
...
@@ -183,7 +183,7 @@ static inline int mbstowcs_dbcs( const struct dbcs_table *table,
for
(
len
=
dstlen
;
srclen
&&
len
;
len
--
,
srclen
--
,
src
++
,
dst
++
)
{
unsigned
char
off
=
cp2uni_lb
[
*
src
];
if
(
off
&&
srclen
>
1
)
if
(
off
&&
srclen
>
1
&&
src
[
1
]
)
{
src
++
;
srclen
--
;
...
...
@@ -212,7 +212,7 @@ static int mbstowcs_dbcs_decompose( const struct dbcs_table *table,
for
(
len
=
0
;
srclen
;
srclen
--
,
src
++
)
{
unsigned
char
off
=
cp2uni_lb
[
*
src
];
if
(
off
&&
srclen
>
1
)
if
(
off
&&
srclen
>
1
&&
src
[
1
]
)
{
src
++
;
srclen
--
;
...
...
@@ -227,7 +227,7 @@ static int mbstowcs_dbcs_decompose( const struct dbcs_table *table,
for
(
len
=
dstlen
;
srclen
&&
len
;
srclen
--
,
src
++
)
{
unsigned
char
off
=
cp2uni_lb
[
*
src
];
if
(
off
&&
srclen
>
1
)
if
(
off
&&
srclen
>
1
&&
src
[
1
]
)
{
src
++
;
srclen
--
;
...
...
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