aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/strpcpy.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-03-12 21:26:39 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-03-12 21:26:39 -0700
commit4171516d8fa8997db187a8d41a51344402c2dc8d (patch)
treefb2e1f310dc4bf6e9b442a09c1bc343767e8aa59 /com32/lib/strpcpy.c
parent14b47f77ec944c0cc8cb56d5e220ce67846dcf4d (diff)
parent7a708f025b241d8aca62014ebe7279fc605b1a46 (diff)
downloadsyslinux.git-4171516d8fa8997db187a8d41a51344402c2dc8d.tar.gz
syslinux.git-4171516d8fa8997db187a8d41a51344402c2dc8d.tar.xz
syslinux.git-4171516d8fa8997db187a8d41a51344402c2dc8d.zip
Merge branch 'hdt'
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;
+}