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
5b435796
Commit
5b435796
authored
Oct 23, 2022
by
Bartosz Kosiorek
Committed by
Alexandre Julliard
Oct 26, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix error handling for strcpy_s.
parent
046bed65
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
string.c
dlls/msvcrt/string.c
+4
-3
No files found.
dlls/msvcrt/string.c
View file @
5b435796
...
...
@@ -1328,9 +1328,9 @@ char* CDECL strcpy(char *dst, const char *src)
int
CDECL
strcpy_s
(
char
*
dst
,
size_t
elem
,
const
char
*
src
)
{
size_t
i
;
if
(
!
elem
)
return
EINVAL
;
if
(
!
dst
)
return
EINVAL
;
if
(
!
src
)
if
(
!
MSVCRT_CHECK_PMT
(
dst
!=
0
)
)
return
EINVAL
;
if
(
!
MSVCRT_CHECK_PMT
(
elem
!=
0
)
)
return
EINVAL
;
if
(
!
MSVCRT_CHECK_PMT
(
src
!=
NULL
)
)
{
dst
[
0
]
=
'\0'
;
return
EINVAL
;
...
...
@@ -1340,6 +1340,7 @@ int CDECL strcpy_s( char* dst, size_t elem, const char* src )
{
if
((
dst
[
i
]
=
src
[
i
])
==
'\0'
)
return
0
;
}
MSVCRT_INVALID_PMT
(
"dst[elem] is too small"
,
ERANGE
);
dst
[
0
]
=
'\0'
;
return
ERANGE
;
}
...
...
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