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
09699142
Commit
09699142
authored
Oct 02, 2008
by
Eric Pouech
Committed by
Alexandre Julliard
Oct 06, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Implemented wcsncpy_s.
parent
6d652ddc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+1
-0
wcs.c
dlls/msvcrt/wcs.c
+31
-0
No files found.
dlls/msvcrt/msvcrt.spec
View file @
09699142
...
...
@@ -772,6 +772,7 @@
@ cdecl wcsncat(wstr wstr long) ntdll.wcsncat
@ cdecl wcsncmp(wstr wstr long) ntdll.wcsncmp
@ cdecl wcsncpy(ptr wstr long) ntdll.wcsncpy
@ cdecl wcsncpy_s(ptr long wstr long) MSVCRT_wcsncpy_s
@ cdecl wcspbrk(wstr wstr) MSVCRT_wcspbrk
@ cdecl wcsrchr(wstr long) ntdll.wcsrchr
@ cdecl wcsspn(wstr wstr) ntdll.wcsspn
...
...
dlls/msvcrt/wcs.c
View file @
09699142
...
...
@@ -1046,3 +1046,34 @@ INT CDECL MSVCRT_wcscpy_s( MSVCRT_wchar_t* wcDest, MSVCRT_size_t numElement, con
return
0
;
}
/******************************************************************
* wcsncpy_s (MSVCRT.@)
*/
INT
CDECL
MSVCRT_wcsncpy_s
(
MSVCRT_wchar_t
*
wcDest
,
MSVCRT_size_t
numElement
,
const
MSVCRT_wchar_t
*
wcSrc
,
MSVCRT_size_t
count
)
{
INT
size
=
0
;
if
(
!
wcDest
||
!
numElement
)
return
MSVCRT_EINVAL
;
wcDest
[
0
]
=
0
;
if
(
!
wcSrc
)
{
return
MSVCRT_EINVAL
;
}
size
=
min
(
strlenW
(
wcSrc
),
count
);
if
(
size
>=
numElement
)
{
return
MSVCRT_ERANGE
;
}
memcpy
(
wcDest
,
wcSrc
,
size
*
sizeof
(
WCHAR
)
);
wcDest
[
size
]
=
'\0'
;
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