[PATCH 21/24] strtok.3: SYNOPSIS: Use 'restrict' in prototypes

Alejandro Colomar
2021-03-10T18:33:09Z

Both POSIX and glibc use 'restrict' in strtok(), strtok_r().
Let's use it here too.

.../glibc$ grep_glibc_prototype strtok
string/string.h:340:
extern char *strtok (char *__restrict __s, const char *__restrict __delim)
__THROW __nonnull ((2));
.../glibc$ grep_glibc_prototype strtok_r
string/string.h:350:
extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
char **__restrict __save_ptr)
__THROW __nonnull ((2, 3));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
man3/strtok.3 | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/man3/strtok.3 b/man3/strtok.3
index 6db48b677..8058ff2fe 100644
--- a/man3/strtok.3
+++ b/man3/strtok.3
@@ -36,8 +36,9 @@ strtok, strtok_r \- extract tokens from strings
.nf
.B #include <string.h>
.PP
-.BI "char *strtok(char *" str ", const char *" delim );
-.BI "char *strtok_r(char *" str ", const char *" delim ", char **" saveptr );
+.BI "char *strtok(char *restrict " str ", const char *restrict " delim );
+.BI "char *strtok_r(char *restrict " str ", const char *restrict " delim ,
+.BI " char **restrict " saveptr );
.fi
.PP
.RS -4
--
2.30.1.721.g45526154a5