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
25bbc7e9
Commit
25bbc7e9
authored
Oct 19, 2022
by
Piotr Caban
Committed by
Alexandre Julliard
Oct 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix error handling in _mbsupr_s_l.
parent
71144728
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
mbcs.c
dlls/msvcrt/mbcs.c
+6
-9
string.c
dlls/msvcrt/tests/string.c
+1
-1
No files found.
dlls/msvcrt/mbcs.c
View file @
25bbc7e9
...
...
@@ -2194,15 +2194,12 @@ unsigned char* CDECL _mbsupr(unsigned char* s)
*/
int
CDECL
_mbsupr_s_l
(
unsigned
char
*
s
,
size_t
len
,
_locale_t
locale
)
{
unsigned
char
*
p
=
s
;
if
(
!
s
&&
!
len
)
{
return
0
;
}
else
if
(
!
s
||
!
len
)
{
*
_errno
()
=
EINVAL
;
if
(
!
MSVCRT_CHECK_PMT
(
s
&&
len
))
return
EINVAL
;
}
if
(
get_mbcinfo
()
->
ismbcodepage
)
{
...
...
@@ -2225,12 +2222,12 @@ int CDECL _mbsupr_s_l(unsigned char* s, size_t len, _locale_t locale)
*
s
=
_toupper_l
(
*
s
,
locale
);
}
if
(
*
s
)
if
(
!
MSVCRT_CHECK_PMT
(
len
)
)
{
*
s
=
'\0'
;
*
_errno
()
=
EINVAL
;
*
p
=
0
;
return
EINVAL
;
}
*
s
=
0
;
return
0
;
}
...
...
dlls/msvcrt/tests/string.c
View file @
25bbc7e9
...
...
@@ -2879,7 +2879,7 @@ static void test__mbsupr_s(void)
memcpy
(
buffer
,
"abcdefgh"
,
sizeof
(
"abcdefgh"
));
errno
=
EBADF
;
ret
=
p_mbsupr_s
(
buffer
,
4
);
ret
=
p_mbsupr_s
(
buffer
,
sizeof
(
"abcdefgh"
)
-
1
);
ok
(
ret
==
EINVAL
,
"Expected _mbsupr_s to return EINVAL, got %d
\n
"
,
ret
);
ok
(
errno
==
EINVAL
,
"Expected errno to be EINVAL, got %d
\n
"
,
errno
);
...
...
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