bug in strtok_r(3) man page
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hello,
Quoted 10 lines · eponymous alias
The 2019-03-06
strtok_r(3)man page says:On the first call to
strtok_r(), str should point to the string to be parsed, and the value of saveptr is ignored.Uh, no. That would make saveptr totally useless. A quick fix would be:
On the first call to
strtok_r(), str should point to the string to be parsed, and the value of *saveptr is ignored.
Thanks. I applied the patch below.
Michael
man3/strtok.3 +2 -2
@@ -146,12 +146,12 @@ On the first call to .BR strtok_r (), .I str should point to the string to be parsed, and the value of -.I saveptr +.I *saveptr is ignored. In subsequent calls, .I str should be NULL, and -.I saveptr +.I *saveptr should be unchanged since the previous call. .PP Different strings may be parsed concurrently using sequences of calls to
Signature · 3 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/