aboutsummaryrefslogtreecommitdiffstats
path: root/man3/string.3
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-11-09 16:12:40 +0100
committerAlejandro Colomar <alx@kernel.org>2023-11-09 16:32:05 +0100
commit7f35db79960be15204cf979bf81e601926fa3458 (patch)
tree55ba0d0b1625799e5f6d220122a5dca618c45881 /man3/string.3
parent5df1866bffeea1f63fb51fe99c77ae227916df92 (diff)
downloadman-pages-7f35db79960be15204cf979bf81e601926fa3458.tar.gz
stpncpy.3, string.3, string_copying.7: Clarify that st[rp]ncpy() pad with null bytes
The previous wording could be interpreted as if the nulls were already in place. Clarify that it's this function which pads with null bytes. Also, it copies "characters" from the src string. That's a bit more specific than copying "bytes", and makes it clearer that the terminating null byte in src is not part of the copy. Suggested-by: Jonny Grant <jg@jguk.org> Cc: DJ Delorie <dj@redhat.com> Cc: Matthew House <mattlloydhouse@gmail.com> Cc: Oskari Pirhonen <xxc3ncoredxx@gmail.com> Cc: Thorsten Kukuk <kukuk@suse.com> Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org> Cc: Zack Weinberg <zack@owlfolio.org> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: Carlos O'Donell <carlos@redhat.com> Cc: Paul Eggert <eggert@cs.ucla.edu> Cc: Xi Ruoyao <xry111@xry111.site> Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'man3/string.3')
-rw-r--r--man3/string.311
1 files changed, 2 insertions, 9 deletions
diff --git a/man3/string.3 b/man3/string.3
index aba5efd2bc..bd8b342a67 100644
--- a/man3/string.3
+++ b/man3/string.3
@@ -179,21 +179,14 @@ to the current locale and copies the first
.I n
bytes to
.IR dest .
-.SS Obsolete functions
.TP
.nf
.BI "char *strncpy(char " dest "[restrict ." n "], \
const char " src "[restrict ." n ],
.BI " size_t " n );
.fi
-Copy at most
-.I n
-bytes from string
-.I src
-to
-.IR dest ,
-returning a pointer to the start of
-.IR dest .
+Fill a fixed‐width buffer with characters from a string
+and pad with null bytes.
.SH DESCRIPTION
The string functions perform operations on null-terminated
strings.