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
7c70b939
Commit
7c70b939
authored
Jun 29, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add strncat_s and wcsncat_s.
Implementation copied from msvcrt. Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
94e960c8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
0 deletions
+84
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+2
-0
string.c
dlls/ntdll/string.c
+41
-0
wcstring.c
dlls/ntdll/wcstring.c
+41
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
7c70b939
...
...
@@ -1595,6 +1595,7 @@
@ cdecl strcspn(str str)
@ cdecl strlen(str)
@ cdecl strncat(str str long)
@ cdecl strncat_s(str long str long)
@ cdecl strncmp(str str long)
@ cdecl strncpy(ptr str long)
@ cdecl strncpy_s(ptr long str long)
...
...
@@ -1626,6 +1627,7 @@
@ cdecl wcscspn(wstr wstr)
@ cdecl wcslen(wstr)
@ cdecl wcsncat(wstr wstr long)
@ cdecl wcsncat_s(wstr long wstr long)
@ cdecl wcsncmp(wstr wstr long)
@ cdecl wcsncpy(ptr wstr long)
@ cdecl wcsncpy_s(ptr long wstr long)
...
...
dlls/ntdll/string.c
View file @
7c70b939
...
...
@@ -333,6 +333,47 @@ char * __cdecl strncat( char *dst, const char *src, size_t len )
/*********************************************************************
* strncat_s (NTDLL.@)
*/
errno_t
__cdecl
strncat_s
(
char
*
dst
,
size_t
len
,
const
char
*
src
,
size_t
count
)
{
size_t
i
,
j
;
if
(
!
dst
||
!
len
)
return
EINVAL
;
if
(
!
count
)
return
0
;
if
(
!
src
)
{
*
dst
=
0
;
return
EINVAL
;
}
for
(
i
=
0
;
i
<
len
;
i
++
)
if
(
!
dst
[
i
])
break
;
if
(
i
==
len
)
{
*
dst
=
0
;
return
EINVAL
;
}
for
(
j
=
0
;
(
j
+
i
)
<
len
;
j
++
)
{
if
(
count
==
_TRUNCATE
&&
j
+
i
==
len
-
1
)
{
dst
[
j
+
i
]
=
0
;
return
STRUNCATE
;
}
if
(
j
==
count
||
!
(
dst
[
j
+
i
]
=
src
[
j
]))
{
dst
[
j
+
i
]
=
0
;
return
0
;
}
}
*
dst
=
0
;
return
ERANGE
;
}
/*********************************************************************
* strncmp (NTDLL.@)
*/
int
__cdecl
strncmp
(
const
char
*
str1
,
const
char
*
str2
,
size_t
len
)
...
...
dlls/ntdll/wcstring.c
View file @
7c70b939
...
...
@@ -269,6 +269,47 @@ LPWSTR __cdecl wcsncat( LPWSTR s1, LPCWSTR s2, size_t n )
/*********************************************************************
* wcsncat_s (NTDLL.@)
*/
errno_t
__cdecl
wcsncat_s
(
wchar_t
*
dst
,
size_t
len
,
const
wchar_t
*
src
,
size_t
count
)
{
size_t
i
,
j
;
if
(
!
dst
||
!
len
)
return
EINVAL
;
if
(
!
count
)
return
0
;
if
(
!
src
)
{
*
dst
=
0
;
return
EINVAL
;
}
for
(
i
=
0
;
i
<
len
;
i
++
)
if
(
!
dst
[
i
])
break
;
if
(
i
==
len
)
{
*
dst
=
0
;
return
EINVAL
;
}
for
(
j
=
0
;
(
j
+
i
)
<
len
;
j
++
)
{
if
(
count
==
_TRUNCATE
&&
j
+
i
==
len
-
1
)
{
dst
[
j
+
i
]
=
0
;
return
STRUNCATE
;
}
if
(
j
==
count
||
!
(
dst
[
j
+
i
]
=
src
[
j
]))
{
dst
[
j
+
i
]
=
0
;
return
0
;
}
}
*
dst
=
0
;
return
ERANGE
;
}
/*********************************************************************
* wcsncmp (NTDLL.@)
*/
int
__cdecl
wcsncmp
(
LPCWSTR
str1
,
LPCWSTR
str2
,
size_t
n
)
...
...
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