mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-30 10:52:50 +00:00
MFC: 325765 (imp) Add notes about overlapping copies.
Add notes to each of these that specifically state that results are undefined if the strings overlap. In the case of memcpy, we document the overlapping behavior on FreeBSD (pre-existing). For str*, it is left unspecified, however, since the default (and x86) implementations do not handle overlapping strings properly. PR: 223653 Approved by: phk (mentor)
This commit is contained in:
parent
cbabf0751d
commit
78b4ca619f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/stable/10/; revision=343326
@ -54,6 +54,11 @@ bytes from string
|
||||
.Fa src
|
||||
to string
|
||||
.Fa dst .
|
||||
If
|
||||
.Fa src
|
||||
and
|
||||
.Fa dst
|
||||
overlap, the results are not defined.
|
||||
.Sh RETURN VALUES
|
||||
The
|
||||
.Fn memcpy
|
||||
|
@ -62,6 +62,11 @@ then add a terminating
|
||||
The string
|
||||
.Fa s
|
||||
must have sufficient space to hold the result.
|
||||
If
|
||||
.Fa s
|
||||
and
|
||||
.Fa append
|
||||
overlap, the results are undefined.
|
||||
.Pp
|
||||
The
|
||||
.Fn strncat
|
||||
@ -72,6 +77,11 @@ characters from
|
||||
.Fa append ,
|
||||
and then adds a terminating
|
||||
.Ql \e0 .
|
||||
If
|
||||
.Fa s
|
||||
and
|
||||
.Fa append
|
||||
overlap, the results are undefined.
|
||||
.Sh RETURN VALUES
|
||||
The
|
||||
.Fn strcat
|
||||
|
@ -63,6 +63,11 @@ to
|
||||
(including the terminating
|
||||
.Ql \e0
|
||||
character.)
|
||||
If
|
||||
.Fa src
|
||||
and
|
||||
.Fa dst
|
||||
overlap, the results are undefined.
|
||||
.Pp
|
||||
The
|
||||
.Fn stpncpy
|
||||
@ -89,6 +94,11 @@ Otherwise,
|
||||
is
|
||||
.Em not
|
||||
terminated.
|
||||
If
|
||||
.Fa src
|
||||
and
|
||||
.Fa dst
|
||||
overlap, the results are undefined.
|
||||
.Sh RETURN VALUES
|
||||
The
|
||||
.Fn strcpy
|
||||
|
Loading…
Reference in New Issue
Block a user