From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/fmtio/gstrcpy.x | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 sys/fmtio/gstrcpy.x (limited to 'sys/fmtio/gstrcpy.x') 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 -- cgit