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
b35404aa
Commit
b35404aa
authored
May 04, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include: Disallow wcsncpy() in Wine, similarly to strncpy().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
85846bfb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
1 deletion
+6
-1
msvcrt.h
dlls/msvcrt/msvcrt.h
+1
-0
string.c
dlls/msvcrt/tests/string.c
+1
-0
wcstring.c
dlls/ntdll/wcstring.c
+1
-0
winbase.h
include/winbase.h
+3
-1
No files found.
dlls/msvcrt/msvcrt.h
View file @
b35404aa
...
...
@@ -31,6 +31,7 @@
#include "windef.h"
#include "winbase.h"
#undef strncpy
#undef wcsncpy
extern
BOOL
sse2_supported
DECLSPEC_HIDDEN
;
...
...
dlls/msvcrt/tests/string.c
View file @
b35404aa
...
...
@@ -33,6 +33,7 @@
/* make it use a definition from string.h */
#undef strncpy
#undef wcsncpy
#include "winbase.h"
#include "winnls.h"
#include "winuser.h"
...
...
dlls/ntdll/wcstring.c
View file @
b35404aa
...
...
@@ -241,6 +241,7 @@ int __cdecl wcsncmp( LPCWSTR str1, LPCWSTR str2, size_t n )
/*********************************************************************
* wcsncpy (NTDLL.@)
*/
#undef wcsncpy
LPWSTR
__cdecl
wcsncpy
(
LPWSTR
s1
,
LPCWSTR
s2
,
size_t
n
)
{
WCHAR
*
ret
=
s1
;
...
...
include/winbase.h
View file @
b35404aa
...
...
@@ -2888,9 +2888,11 @@ static inline LPSTR WINAPI lstrcatA( LPSTR dst, LPCSTR src )
return
strcat
(
dst
,
src
);
}
/* strncpy
doesn't do what you think, don't use it
*/
/* strncpy
/wcsncpy don't do what you think, don't use them
*/
#undef strncpy
#undef wcsncpy
#define strncpy(d,s,n) error do_not_use_strncpy_use_lstrcpynA_or_memcpy_instead
#define wcsncpy(d,s,n) error do_not_use_wcsncpy_use_lstrcpynW_or_memcpy_instead
#endif
/* !defined(__WINESRC__) || defined(WINE_NO_INLINE_STRING) */
...
...
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