logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

pmstrncpy - safe string copy

C Synopsis

#include<pcp/pmapi.h>intpmstrncpy(char*dest,size_tdestlen,char*src);cc...-lpcp

Description

pmstrncpy is safe string copying routine with semantics similar to strncpy(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 pmstrncpy ensures  that  dest  is  null-byte
       terminated, even when strlen(src) is larger than destlen.

       On  success,  pmstrncpy returns 0, else -1 indicates that src is too big and the result been truncated to
       ensure dest has no been overrun.

Name

pmstrncpy - safe string copy

See Also

pmstrncat(3) and strncpy(3).

Performance Co-Pilot                                   PCP                                          PMSTRNCPY(3)

See Also