linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: bug in strtok_r(3) man page
       [not found] <707183138.6864091.1568969037896@mail.yahoo.com>
@ 2019-09-23 12:24 ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; only message in thread
From: Michael Kerrisk (man-pages) @ 2019-09-23 12:24 UTC (permalink / raw)
  To: eponymous alias; +Cc: mtk.manpages, linux-man

Hello,

On 9/20/19 10:43 AM, eponymous alias wrote:
> 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

diff --git a/man3/strtok.3 b/man3/strtok.3
index 32552534e..9efb18a8d 100644
--- a/man3/strtok.3
+++ b/man3/strtok.3
@@ -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


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-23 12:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <707183138.6864091.1568969037896@mail.yahoo.com>
2019-09-23 12:24 ` bug in strtok_r(3) man page Michael Kerrisk (man-pages)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).