public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Jayakrishna Vadayath <jvadayat@asu.edu>
To: Florian Weimer <fweimer@redhat.com>
Cc: Jayakrishna Vadayath via Libc-alpha <libc-alpha@sourceware.org>
Subject: Re: Implementation of strtok
Date: Thu, 1 Jun 2023 22:52:56 -0700	[thread overview]
Message-ID: <CAFrQ_54y6MzWBsa5qBLW=oDMLAG4XHAWBAzjNsRTJPbn82x5Sg@mail.gmail.com> (raw)
In-Reply-To: <87edmupgkl.fsf@oldenburg.str.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 921 bytes --]

Hi,

The man page of strtok mention that strtok returns a pointer to the next
token or NULL if there are no more tokens :
https://man7.org/linux/man-pages/man3/strtok.3.html
I can see how the "no more tokens" would apply in this case, but it seems
like not many people are aware of this case.

Can you list the descriptions of strtok that explain this behavior ?
I am very interested in reading about it.

Thank you.

On Thu, Jun 1, 2023 at 10:40 PM Florian Weimer <fweimer@redhat.com> wrote:

> * Jayakrishna Vadayath via Libc-alpha:
>
> > According to the documentation of the strchr and strtok functions, it
> would
> > appear that (1) will never be executed.
>
> I looked at various descriptions of strtok, and they are pretty clear
> that the implemented behavior is required.  Where did you find
> conflicting information?
>
> Thanks,
> Florian
>
>

-- 
Regards
Jayakrishna Menon

  reply	other threads:[~2023-06-02  5:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-02  5:22 Jayakrishna Vadayath
2023-06-02  5:40 ` Florian Weimer
2023-06-02  5:52   ` Jayakrishna Vadayath [this message]
2023-06-02  6:05     ` Florian Weimer
2023-06-02  6:17       ` Jayakrishna Vadayath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFrQ_54y6MzWBsa5qBLW=oDMLAG4XHAWBAzjNsRTJPbn82x5Sg@mail.gmail.com' \
    --to=jvadayat@asu.edu \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).