Linux-man Archive on lore.kernel.org
 help / color / 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	[flat|nested] only message in thread

only message in thread, back to index

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)

Linux-man Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-man/0 linux-man/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-man linux-man/ https://lore.kernel.org/linux-man \
		linux-man@vger.kernel.org linux-man@archiver.kernel.org
	public-inbox-index linux-man

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-man


AGPL code for this site: git clone https://public-inbox.org/ public-inbox