]> pd.if.org Git - pdclib/blobdiff - functions/string/strcpy.c
Re-import from Subversion.
[pdclib] / functions / string / strcpy.c
index 03b8563393f53d141a99b6109fd4c681fb1c341f..f9b340ef691d6944cf000eb59d117f43be71a9bd 100644 (file)
@@ -1,28 +1,16 @@
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
 
-char * strcpy( char * restrict s1, const char * restrict s2 ) { /* TODO */ };
-
-/* Therx code - unreviewed
+char * strcpy( char * restrict dest, const char * restrict src )
 {
-    while (*s1++ = *s2++)
+    char * tmp = dest;
+    while ( ( *dest++ = *src++ ) != '\0' )
     {
-        // EMPTY
+        /* EMPTY */
     }
-    return s1;
-}
-*/
-
-/* PDPC code - unreviewed
-char *strcpy(char *s1, const char *s2)
-{
-    char *p = s1;
-    
-    while ((*p++ = *s2++) != '\0') ;
-    return (s1);
+    return tmp;
 }
-*/
\ No newline at end of file