1
2PMSTRNCAT(3)               Library Functions Manual               PMSTRNCAT(3)
3
4
5

NAME

7       pmstrncat - safe string concatenation
8

C SYNOPSIS

10       #include <pcp/pmapi.h>
11
12       int pmstrncat(char *dest, size_t destlen, char *src);
13
14       cc ... -lpcp
15

DESCRIPTION

17       pmstrncat  is  safe string concatenation routine with semantics similar
18       to strncat(3).
19
20       The main differences are that src must be null-byte terminated, destlen
21       is  the  length  of the destination buffer (dest) not the length of the
22       source string (src), and pmstrncat ensures that dest is null-byte  ter‐
23       minated,  even  when  strlen(src) is larger than the remaining space in
24       dest (destlen - strlen(dest) on entry).
25
26       On success, pmstrncat returns 0, else -1 indicates that src is too  big
27       and the result been truncated to ensure dest has no been overrun.
28

SEE ALSO

30       pmstrncpy(3) and strncat(3).
31
32
33
34Performance Co-Pilot                  PCP                         PMSTRNCAT(3)
Impressum