summaryrefslogtreecommitdiffstats
path: root/usr/klibc/strcpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/klibc/strcpy.c')
-rw-r--r--usr/klibc/strcpy.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/usr/klibc/strcpy.c b/usr/klibc/strcpy.c
new file mode 100644
index 0000000..aa656cf
--- /dev/null
+++ b/usr/klibc/strcpy.c
@@ -0,0 +1,20 @@
+/*
+ * strcpy.c
+ *
+ * strcpy()
+ */
+
+#include <string.h>
+
+char *strcpy(char *dst, const char *src)
+{
+ char *q = dst;
+ const char *p = src;
+ char ch;
+
+ do {
+ *q++ = ch = *p++;
+ } while (ch);
+
+ return dst;
+}