безопасная конкатенация строк (safe string concatenation)
Имя (Name)
pmstrncat
- safe string concatenation
Синопсис C (C Synopsis)
#include <pcp/pmapi.h>
int pmstrncat(char *
dest, size_t
destlen, char *
src);
cc ... -lpcp
Описание (Description)
pmstrncat
is safe string concatenation routine with semantics
similar to strncat(3).
The main differences are that src must be null-byte terminated,
destlen is the length of the destination buffer (dest) not the
length of the source string (src), and pmstrncat
ensures that
dest is null-byte terminated, even when strlen(src) is larger
than the remaining space in dest (destlen - strlen(dest) on
entry).
On success, pmstrncat
returns 0, else -1 indicates that src is
too big and the result been truncated to ensure dest has no been
overrun.
Смотри также (See also)
pmstrncpy(3) and strncat(3).