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
fdffe548
Commit
fdffe548
authored
Mar 30, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 30, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Added space for nullbyte in size returned by wcstombs_s and mbstowcs_s.
parent
f54b1688
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
mbcs.c
dlls/msvcrt/mbcs.c
+1
-1
string.c
dlls/msvcrt/tests/string.c
+8
-0
wcs.c
dlls/msvcrt/wcs.c
+1
-1
No files found.
dlls/msvcrt/mbcs.c
View file @
fdffe548
...
...
@@ -1900,7 +1900,7 @@ int CDECL MSVCRT__mbstowcs_s_l(MSVCRT_size_t *ret, MSVCRT_wchar_t *wcstr,
if
(
!
wcstr
&&
!
size
)
{
conv
=
MSVCRT__mbstowcs_l
(
NULL
,
mbstr
,
0
,
locale
);
if
(
ret
)
*
ret
=
conv
;
*
ret
=
conv
+
1
;
return
0
;
}
...
...
dlls/msvcrt/tests/string.c
View file @
fdffe548
...
...
@@ -1337,6 +1337,10 @@ static void test_mbstowcs(void)
ok
(
ret
==
3
,
"ret = %d
\n
"
,
(
int
)
ret
);
ok
(
!
memcmp
(
wOut
,
wHiragana
,
sizeof
(
wHiragana
)),
"wOut = %s
\n
"
,
wine_dbgstr_w
(
wOut
));
err
=
pmbstowcs_s
(
&
ret
,
NULL
,
0
,
mHiragana
,
1
);
ok
(
err
==
0
,
"err = %d
\n
"
,
err
);
ok
(
ret
==
3
,
"ret = %d
\n
"
,
(
int
)
ret
);
err
=
pwcstombs_s
(
&
ret
,
mOut
,
6
,
wSimple
,
_TRUNCATE
);
ok
(
err
==
0
,
"err = %d
\n
"
,
err
);
ok
(
ret
==
5
,
"ret = %d
\n
"
,
(
int
)
ret
);
...
...
@@ -1346,6 +1350,10 @@ static void test_mbstowcs(void)
ok
(
err
==
0
,
"err = %d
\n
"
,
err
);
ok
(
ret
==
5
,
"ret = %d
\n
"
,
(
int
)
ret
);
ok
(
!
memcmp
(
mOut
,
mHiragana
,
sizeof
(
mHiragana
)),
"mOut = %s
\n
"
,
mOut
);
err
=
pwcstombs_s
(
&
ret
,
NULL
,
0
,
wHiragana
,
1
);
ok
(
err
==
0
,
"err = %d
\n
"
,
err
);
ok
(
ret
==
5
,
"ret = %d
\n
"
,
(
int
)
ret
);
}
static
void
test_gcvt
(
void
)
...
...
dlls/msvcrt/wcs.c
View file @
fdffe548
...
...
@@ -341,7 +341,7 @@ MSVCRT_size_t CDECL MSVCRT__wcstombs_s_l(MSVCRT_size_t *ret, char *mbstr,
if
(
!
mbstr
&&
!
size
)
{
conv
=
MSVCRT__wcstombs_l
(
NULL
,
wcstr
,
0
,
locale
);
if
(
ret
)
*
ret
=
conv
;
*
ret
=
conv
+
1
;
return
0
;
}
...
...
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