rewritten from the manual page; add Berkeley specific header
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 19 Jul 1988 07:25:39 +0000 (23:25 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 19 Jul 1988 07:25:39 +0000 (23:25 -0800)
SCCS-vsn: lib/libc/string/strcpy.c 5.3

usr/src/lib/libc/string/strcpy.c

index ed5bd2d..289033c 100644 (file)
@@ -1,20 +1,30 @@
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)strcpy.c   5.2 (Berkeley) %G%";
-#endif LIBC_SCCS and not lint
-
 /*
 /*
- * Copy string s2 to s1.  s1 must be large enough.
- * return s1
+ * Copyright (c) 1988 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
  */
 
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)strcpy.c   5.3 (Berkeley) %G%";
+#endif /* LIBC_SCCS and not lint */
+
 char *
 char *
-strcpy(s1, s2)
-register char *s1, *s2;
+strcpy(to, from)
+       register char *to, *from;
 {
 {
-       register char *os1;
+       char *save = to;
 
 
-       os1 = s1;
-       while (*s1++ = *s2++)
-               ;
-       return(os1);
+       for (; *from = *to; ++from, ++to);
+       return(save);
 }
 }