aboutsummaryrefslogtreecommitdiff
path: root/sys/fmtio/gstrcpy.x
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fmtio/gstrcpy.x')
-rw-r--r--sys/fmtio/gstrcpy.x19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/fmtio/gstrcpy.x b/sys/fmtio/gstrcpy.x
new file mode 100644
index 00000000..e2d6e7b1
--- /dev/null
+++ b/sys/fmtio/gstrcpy.x
@@ -0,0 +1,19 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+# GSTRCPY -- Copy string s1 to s2, return the number of characters copied.
+
+int procedure gstrcpy (s1, s2, maxch)
+
+char s1[ARB], s2[ARB]
+int maxch, i
+
+begin
+ do i = 1, maxch {
+ s2[i] = s1[i]
+ if (s2[i] == EOS)
+ return (i - 1)
+ }
+
+ s2[maxch+1] = EOS
+ return (maxch)
+end