pmstrncat - Man Page

safe string concatenation

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 between pmstrncat and strncat(3) are:

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.

History

strncat(3) first appeared in Edition 7 AT&T Unix around 1979. It was specifically crafted to construct file pathnames (which needed to be null-byte terminated) from component names from on-disk directory entries that were of a fixed maximum size and may have zero, one or more trailing null-bytes

The subsequent attempts to use strncat(3) for more generally string concatenation operations has been fraught with abuse and security issues; pmstrncat is an attempt to address these problems.

See Also

PMAPI(3), pmstrncpy(3), strncat(3) and strncpy(3).

Referenced By

pmstrncpy(3).

PCP Performance Co-Pilot