Home  /  Autodocs  /  utility.library

NAME

Strncat
concatenate two strings, length limited (V47)

SYNOPSIS

end = Strncat(dst,src,size)
D0 A1 A0 D0

UBYTE *Strncat(UBYTE *dst,const UBYTE *src,ULONG bufsize);

FUNCTION

Appends the source string at the end of the destionation string possibly truncating the result to fit to the buffer. Returns a pointer to the terminating NUL of the target string, or NULL if the string was truncated.

INPUTS

src
source string to be appended. If NULL, it is treated as if it were an empty string.

dst
buffer to write to, or NULL. In case the target buffer is NULL, NULL is returned immediately.

bufsize
size of the target buffer in bytes. If this is 0, then no data is copied and NULL is returned immediately.

RESULT

end
pointer to the NUL byte of the target string, or NULL in case the target was truncated.

NOTES

The curious return code allows easy chaining of multiple Strncat() calls. Even in case the target was truncated, it is always NUL terminated.

SEE ALSO

RawDoFmt()