summaryrefslogtreecommitdiff
path: root/reference/C/CONTRIB/SNIP/sstrcpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'reference/C/CONTRIB/SNIP/sstrcpy.c')
-rwxr-xr-xreference/C/CONTRIB/SNIP/sstrcpy.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/reference/C/CONTRIB/SNIP/sstrcpy.c b/reference/C/CONTRIB/SNIP/sstrcpy.c
new file mode 100755
index 0000000..fd8531b
--- /dev/null
+++ b/reference/C/CONTRIB/SNIP/sstrcpy.c
@@ -0,0 +1,13 @@
+#include <string.h>
+
+char *sstrcpy(char *to, char *from)
+{
+ memmove(to, from, 1+strlen(from));
+ return to;
+}
+
+char *sstrcat(char *to, char *from)
+{
+ sstrcpy(to + strlen(to), from);
+ return to;
+}