| T X T _ S T R N C A T ( )
| | | | | SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English INDEP - TXT_#?
----------------------------------------------------------------------------
NAME
txt_strncat() - Concatenate two strings.
SYNOPSIS
len = txt_strncat(dst, src, dlen);
LONG txt_strncat(UBYTE *, UBYTE *, LONG);
FUNCTION
This function appends 'src' NULL terminated string to 'dst'
NULL terminated string, regarding available space in 'dst'.
INPUTS
dst - Destination string.
src - Source string.
dlen - Destinantion length.
RETURNS
Returns amount of data that was put in the destination.
Overflow will be indicated by inverting the value, so neg.
result means that the data was truncated. 0 will mean that
no copy took place.
BASES
None.
NOTES
This function is slightly different than normal 'strncat()',
instead of length of source string it expects the dest. len.
which is much safier on non-MMU systems.
This function can successfully be used as 'strncpy()' as
well. In such case you have to remember to NULL the first
byte of the destination buffer.
This func. comes with two more variants: 'txt_strncatlc()' &
'txt_strncatuc()' who allow to transform the text on the
fly to lower or upper case.
Truncation can be detected by adding buffer size to the
output of the function. If it is 1 then the last call did
truncate the output.
SEE ALSO
EXAMPLE
...
#define SIZE 256
...
UBYTE buf[SIZE] = {0};
txt_strncat(buf, "Hello ", SIZE);
txt_strncat(buf, "world!", SIZE);
BUGS
None known.
----------------------------------------------------------------------------
| |
| |