]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
strcpy.3: SYNOPSIS: Use 'restrict' in prototypes
authorAlejandro Colomar <alx.manpages@gmail.com>
Wed, 10 Mar 2021 18:31:38 +0000 (19:31 +0100)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Sun, 14 Mar 2021 20:40:45 +0000 (21:40 +0100)
Both POSIX and glibc use 'restrict' in strcpy(), strncpy().
Let's use it here too.

.../glibc$ grep_glibc_prototype strcpy
string/string.h:125:
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
     __THROW __nonnull ((1, 2));
.../glibc$ grep_glibc_prototype strncpy
string/string.h:128:
extern char *strncpy (char *__restrict __dest,
      const char *__restrict __src, size_t __n)
     __THROW __nonnull ((1, 2));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man3/strcpy.3

index 46993cdb3fe137f3043a848aacf7f938466a1182..ade8b94127a2ed76b33d99fb0a679ba615737477 100644 (file)
@@ -39,8 +39,9 @@ strcpy, strncpy \- copy a string
 .nf
 .B #include <string.h>
 .PP
-.BI "char *strcpy(char *" dest ", const char *" src );
-.BI "char *strncpy(char *" dest ", const char *" src ", size_t " n );
+.BI "char *strcpy(char *restrict " dest ", const char *" src );
+.BI "char *strncpy(char *restrict " dest ", const char *restrict " src \
+", size_t " n );
 .fi
 .SH DESCRIPTION
 The