one_strlcat

Starlink compliant wrapper around the BSD strlcat function

Description:

The strlcat function is similar to the strncat 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_strlcat( char ∗ dest, const char ∗ src, size_t sizedest, int ∗ status );

Arguments

dest = char ∗ (Returned)
Destination buffer for "src". Must be nul-terminated. If status is bad on entry ”dest” will not be touched.
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 appending. Will either be the length of the source string or one less than the size of the destination buffer.

Notes: