strtok.3: Add portability note for strtok_r() '*saveptr' value

On some implementations, '*saveptr' must be NULL on first call
to strtok_r().

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2019-09-26 08:01:52 +02:00
parent 85987f9818
commit e72ae85154
1 changed files with 9 additions and 1 deletions

View File

@ -147,7 +147,7 @@ On the first call to
.I str
should point to the string to be parsed, and the value of
.I *saveptr
is ignored.
is ignored (but see NOTES).
In subsequent calls,
.I str
should be NULL, and
@ -189,6 +189,14 @@ POSIX.1-2001, POSIX.1-2008, C89, C99, SVr4, 4.3BSD.
.TP
.BR strtok_r ()
POSIX.1-2001, POSIX.1-2008.
.SH NOTES
On some implementations,
.\" Tru64, according to its manual page
.I *saveptr
is required to be NULL on the first call to
.BR strtok_r ()
that is being used to parse
.IR str .
.SH BUGS
Be cautious when using these functions.
If you do use them, note that: