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
9a335d89
Commit
9a335d89
authored
Oct 20, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Always set output length in encoding conversion.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
06f66373
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
main.c
dlls/msxml3/main.c
+6
-6
No files found.
dlls/msxml3/main.c
View file @
9a335d89
...
...
@@ -233,9 +233,9 @@ static void init_libxslt(void)
static
int
to_utf8
(
int
cp
,
unsigned
char
*
out
,
int
*
outlen
,
const
unsigned
char
*
in
,
int
*
inlen
)
{
WCHAR
*
tmp
;
int
len
;
int
len
=
0
;
if
(
!
in
||
!
inlen
)
return
0
;
if
(
!
in
||
!
inlen
)
goto
done
;
len
=
MultiByteToWideChar
(
cp
,
0
,
(
const
char
*
)
in
,
*
inlen
,
NULL
,
0
);
tmp
=
heap_alloc
(
len
*
sizeof
(
WCHAR
));
...
...
@@ -245,7 +245,7 @@ static int to_utf8(int cp, unsigned char *out, int *outlen, const unsigned char
len
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
tmp
,
len
,
(
char
*
)
out
,
*
outlen
,
NULL
,
NULL
);
heap_free
(
tmp
);
if
(
!
len
)
return
-
1
;
done:
*
outlen
=
len
;
return
len
;
}
...
...
@@ -253,9 +253,9 @@ static int to_utf8(int cp, unsigned char *out, int *outlen, const unsigned char
static
int
from_utf8
(
int
cp
,
unsigned
char
*
out
,
int
*
outlen
,
const
unsigned
char
*
in
,
int
*
inlen
)
{
WCHAR
*
tmp
;
int
len
;
int
len
=
0
;
if
(
!
in
||
!
inlen
)
return
0
;
if
(
!
in
||
!
inlen
)
goto
done
;
len
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
(
const
char
*
)
in
,
*
inlen
,
NULL
,
0
);
tmp
=
heap_alloc
(
len
*
sizeof
(
WCHAR
));
...
...
@@ -265,7 +265,7 @@ static int from_utf8(int cp, unsigned char *out, int *outlen, const unsigned cha
len
=
WideCharToMultiByte
(
cp
,
0
,
tmp
,
len
,
(
char
*
)
out
,
*
outlen
,
NULL
,
NULL
);
heap_free
(
tmp
);
if
(
!
len
)
return
-
1
;
done:
*
outlen
=
len
;
return
len
;
}
...
...
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