*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: stpcpy | Section: 3 | Source: NetBSD | File: stpcpy.3
STRCPY(3) FreeBSD Library Functions Manual STRCPY(3) NAME stpcpy, strcpy - copy strings LIBRARY Standard C Library (libc, -lc) SYNOPSIS #include <string.h> char * stpcpy(char * restrict dst, const char * restrict src); char * strcpy(char * restrict dst, const char * restrict src); DESCRIPTION The stpcpy() and strcpy() functions copy the string src to dst, including the terminating NUL byte. The strings src and dst may not overlap. The string src must be terminated by a NUL byte. The memory for dst must have space for strlen(src) + 1 bytes. RETURN VALUES The strcpy() function returns dst. The stpcpy() function returns a pointer to the terminating NUL byte of dst. SEE ALSO bcopy(3), memccpy(3), memcpy(3), memmove(3), strlcpy(3), strncpy(3), wcscpy(3) STANDARDS The strcpy() function conforms to ISO/IEC 9899:1999 ("ISO C99"). The stpcpy() function conforms to IEEE Std 1003.1-2008 ("POSIX.1"). HISTORY The stpcpy() function first appeared in NetBSD 6.0. SECURITY CONSIDERATIONS The strcpy() and stpcpy() functions copy until a NUL terminator without any bounds checks on the size of the input or output buffers. If the input buffer is missing a NUL terminator, or the input string is longer than the output buffer, this can lead to crashes or security vulnerabilities from buffer overruns, including disclosure of secrets in memory and arbitrary code execution. The strlcpy(3) function is a safer replacement for strcpy() which allows the caller to specify the space allocated for dst. strlcpy(3), or snprintf(3) with a format string of "%s", should be used instead of strcpy() and stpcpy() wherever possible to avoid buffer overruns in dst. (However, they still require src to be NUL-terminated.) FreeBSD 14.1-RELEASE-p8 August 11, 2023 FreeBSD 14.1-RELEASE-p8

Navigation Options