Commit b35404aa authored by Alexandre Julliard's avatar Alexandre Julliard

include: Disallow wcsncpy() in Wine, similarly to strncpy().

parent 85846bfb
......@@ -31,6 +31,7 @@
#include "windef.h"
#include "winbase.h"
#undef strncpy
#undef wcsncpy
extern BOOL sse2_supported DECLSPEC_HIDDEN;
......
......@@ -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"
......
......@@ -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;
......
......@@ -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) */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment