aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/strpcpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'com32/lib/strpcpy.c')
-rw-r--r--com32/lib/strpcpy.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/com32/lib/strpcpy.c b/com32/lib/strpcpy.c
new file mode 100644
index 00000000..e181e78f
--- /dev/null
+++ b/com32/lib/strpcpy.c
@@ -0,0 +1,20 @@
+/*
+ * strpcpy.c
+ *
+ * strpcpy() - strcpy() which returns a pointer to the final null
+ */
+
+#include <string.h>
+
+char *strpcpy(char *dst, const char *src)
+{
+ char *q = dst;
+ const char *p = src;
+ char ch;
+
+ do {
+ *q++ = ch = *p++;
+ } while ( ch );
+
+ return q-1;
+}