aboutsummaryrefslogtreecommitdiff
path: root/pkg/utilities/nttools/stxtools/sp_util/spstry.x
blob: 545b0b0698a82c90bcc4d669039bf9713cbaf222 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# sp_strncpy - Counted character copy.
#
# History
#   1Apr91 - Created by Jonathan D. Eisenhamer, STScI.
#---------------------------------------------------------------------------

procedure sp_strncpy( input, n_chars, output )

char input[ARB]   # I:  The input string to copy to the output.
int  n_chars      # I:  The number of characters to copy.
char output[ARB]  # O:  The output string.

# Declarations.
int i             # Index.

begin

  for( i = 1; i <= n_chars; i = i + 1 )
    output[i] = input[i]

end
#---------------------------------------------------------------------------
# End of sp_strncpy.
#---------------------------------------------------------------------------