From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- 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