Author: cwittich
Date: Wed Apr 22 22:53:21 2009
New Revision: 40654
URL:
http://svn.reactos.org/svn/reactos?rev=40654&view=rev
Log:
import strcpy_s from wine
Modified:
trunk/reactos/dll/win32/msvcrt/msvcrt.def
trunk/reactos/lib/sdk/crt/string/string.c
Modified: trunk/reactos/dll/win32/msvcrt/msvcrt.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvcrt/msvcrt.de…
==============================================================================
--- trunk/reactos/dll/win32/msvcrt/msvcrt.def [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msvcrt/msvcrt.def [iso-8859-1] Wed Apr 22 22:53:21 2009
@@ -852,5 +852,6 @@
_ftol2=_ftol
_ftol2_sse=_ftol
strcat_s
+ strcpy_s
_swprintf=swprintf
Modified: trunk/reactos/lib/sdk/crt/string/string.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/string/string.…
==============================================================================
--- trunk/reactos/lib/sdk/crt/string/string.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/string/string.c [iso-8859-1] Wed Apr 22 22:53:21 2009
@@ -62,3 +62,26 @@
dst[0] = '\0';
return ERANGE;
}
+
+/*********************************************************************
+ * strcpy_s (MSVCRT.@)
+ */
+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)
+ {
+ dst[0] = '\0';
+ return EINVAL;
+ }
+
+ for(i = 0; i < elem; i++)
+ {
+ if((dst[i] = src[i]) == '\0') return 0;
+ }
+ dst[0] = '\0';
+ return ERANGE;
+}
+