STPCPY(3)

NAME
stpcpy, stpncpy - copy strings

SYNOPSIS
#include <string.h>
char *
stpcpy(char *dst, const char *src);
char *
stpncpy(char *dst, const char *src, size_t len);

DESCRIPTION
The stpcpy() and stpncpy() functions copy the string src to dst (including the terminating ‘\0’ character).

The stpncpy() function copies not more than len characters into dst, appending ‘\0’ characters if src is less than len characters long, and not terminating dst if the length of src is greater than or equal to len.

RETURN VALUES
The stpcpy() function returns a pointer to the terminating ‘\0’ character written into dst.

The stpncpy() function returns a pointer to the first ‘\0’ character written into dst, or to &dst[len] if the length of src is greater than or equal to len.

SEE ALSO
strcpy(3), strlcpy(3), strncpy(3)

STANDARDS
The stpcpy() and stpncpy() functions conform to p1003.1-2008.

HISTORY
The stpcpy() and stpncpy() functions first appeared in OpenBSD 5.1.