Description:
The strlcpy
function is similar to the strncpy function except that it guarantees to nul terminate the destination
string and returns the number of characters that will have been copied. This wrapper function
provides standard Starlink inherited status semantics.
Invocation
len = one_strlcpy( char
dest, const char
src, size_t sizedest,
int status );
Arguments
dest = char
(Returned)
Destination buffer for "src". Will be nul-terminated. If status is
bad on entry, dest will be nul-terminated if it is non-NULL.
src = const char
(Given)
String to be copied.
sizedest = size_t (Given)
The actual buffer size of "dest" including space for a nul.
status = int
(Given and Returned)
Inherited status. Will be set to ONE__TRUNC if the string was truncated on
copy.
Returned Value
size_t retval
Length of the string after copying. Will either be the
length of the source string or one less than the size of the destination buffer.
Notes:
Copyright © 2000 Council for the Central Laboratory of the Research Councils