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

NAME

7       pmstrncpy - safe string copy
8

C SYNOPSIS

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

DESCRIPTION

17       pmstrncpy  is  safe  string  copying  routine with semantics similar to
18       strncpy(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 pmstrncpy ensures that dest is null-byte  ter‐
23       minated, even when strlen(src) is larger than destlen.
24
25       On  success, pmstrncpy returns 0, else -1 indicates that src is too big
26       and the result been truncated to ensure dest has no been overrun.
27

SEE ALSO

29       pmstrncat(3) and strncpy(3).
30
31
32
33Performance Co-Pilot                  PCP                         PMSTRNCPY(3)
Impressum