summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/strcpy.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/string/strcpy.3')
-rw-r--r--src/lib/libc/string/strcpy.310
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libc/string/strcpy.3 b/src/lib/libc/string/strcpy.3
index 8304508df6..504f42f2ba 100644
--- a/src/lib/libc/string/strcpy.3
+++ b/src/lib/libc/string/strcpy.3
@@ -29,7 +29,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 30.\" SUCH DAMAGE.
31.\" 31.\"
32.\" $OpenBSD: strcpy.3,v 1.12 2003/06/02 20:18:38 millert Exp $ 32.\" $OpenBSD: strcpy.3,v 1.13 2005/02/25 03:12:44 cloder Exp $
33.\" 33.\"
34.Dd June 29, 1991 34.Dd June 29, 1991
35.Dt STRCPY 3 35.Dt STRCPY 3
@@ -98,12 +98,12 @@ to
98.Dq abcdef 98.Dq abcdef
99and does 99and does
100.Em not 100.Em not
101null terminate 101NUL terminate
102.Va chararray 102.Va chararray
103because the source string is >= the length parameter. 103because the source string is >= the length parameter.
104.Fn strncpy 104.Fn strncpy
105.Em only 105.Em only
106null terminates the destination string when the length of the source 106NUL terminates the destination string when the length of the source
107string is less than the length parameter. 107string is less than the length parameter.
108.Bd -literal -offset indent 108.Bd -literal -offset indent
109(void)strncpy(chararray, "abcdefgh", 6); 109(void)strncpy(chararray, "abcdefgh", 6);
@@ -113,12 +113,12 @@ The following copies as many characters from
113.Va input 113.Va input
114to 114to
115.Va buf 115.Va buf
116as will fit and null terminates the result. 116as will fit and NUL terminates the result.
117Because 117Because
118.Fn strncpy 118.Fn strncpy
119does 119does
120.Em not 120.Em not
121guarantee to null terminate the string itself, we must do this by hand. 121guarantee to NUL terminate the string itself, we must do this by hand.
122.Bd -literal -offset indent 122.Bd -literal -offset indent
123char buf[BUFSIZ]; 123char buf[BUFSIZ];
124 124