]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
strncat.3: Rename third parameter to ssize
authorAlejandro Colomar <alx@kernel.org>
Tue, 21 Nov 2023 15:21:55 +0000 (16:21 +0100)
committerAlejandro Colomar <alx@kernel.org>
Tue, 21 Nov 2023 18:30:47 +0000 (19:30 +0100)
This better clarifies that the size is of src.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
man3/strncat.3

index 2f17e2b77d6d25417af37d3fb0518540e0dc58a9..fb272ca4cebd971079a774d79cd968504eaf9387 100644 (file)
@@ -13,8 +13,8 @@ Standard C library
 .nf
 .B #include <string.h>
 .P
-.BI "char *strncat(char *restrict " dst ", const char " src "[restrict ." sz ],
-.BI "              size_t " sz );
+.BI "char *strncat(char *restrict " dst ", const char " src "[restrict ." ssize ],
+.BI "              size_t " ssize );
 .fi
 .SH DESCRIPTION
 This function appends the input character sequence
@@ -23,19 +23,19 @@ into a string at the buffer pointed to by
 .IR dst .
 The programmer is responsible for allocating a destination buffer large enough,
 that is,
-.IR "strlen(dst) + strnlen(src, sz) + 1" .
+.IR "strlen(dst) + strnlen(src, ssize) + 1" .
 .P
 An implementation of this function might be:
 .P
 .in +4n
 .EX
 char *
-strncat(char *restrict dst, const char *restrict src, size_t sz)
+strncat(char *restrict dst, const char *restrict src, size_t ssize)
 {
     char    *p;
     size_t  len;
 \&
-    len = strnlen(src, sz);
+    len = strnlen(src, ssize);
     p = dst + strlen(dst);
     p = mempcpy(p, src, len);
     *p = \[aq]\e0\[aq];