From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x1129.google.com (mail-yw1-x1129.google.com [IPv6:2607:f8b0:4864:20::1129]) by sourceware.org (Postfix) with ESMTPS id B87CE3858D1E for ; Fri, 2 Jun 2023 05:53:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B87CE3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=asu.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=asu.edu Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-565a022ef06so18074517b3.3 for ; Thu, 01 Jun 2023 22:53:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=asu-edu.20221208.gappssmtp.com; s=20221208; t=1685685189; x=1688277189; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CNZTq2krnx22Dj1BXs4JJZAcAtbvjczss7sNhPTWT1A=; b=ZsSEDsdiTxewkLdJpgUiKzMud5lvYmEen3uZR1tBZEnFxQjSILD9yp9hvnBNOTEkT+ apTn9nXoxRbCGTQM9dR6hmXTTXqFpKCuXDdEXRnY6KRRTcYiP5oXK+KxEDGG+6rN7pcl lBfyenH6aLDcXjKnOJsgQ5YEhYsOHZIZ2VzxnaDvIWidFFqIONcntJt2v7Ln2mJr7G6t Of4GvFwTl88TnIAkdlDRX9DUXR58JxY7RK+6+1Ws+mWjUlMdkIp3nBscAFAwigSXP/Bl X9OePkAUf0nVBeOVfIDAp7LWFnGQQIzq57J7aDG2v1EGcI+KlS1uIEMwjVSYc5e3/rvw H85A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685685189; x=1688277189; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CNZTq2krnx22Dj1BXs4JJZAcAtbvjczss7sNhPTWT1A=; b=MBKbsvbYeFPjymHJ/6SsGDtVkeah1rOfNyacKzJMimhQCKL6UYd+pbbufGvpDb1KsG ErBi5bpnDGNPhNELiG9dLXLNlgClcHVaOAooKMPh1Ti3/cvywIGFcSS9vhJCsQqeHPNl 9J+ZxTeodUDbt6cBYvwiY+wFA9sQte5iYJ/usNIVU1iqwRaCEe6YYNijJYgM/dlTw/Eq /FpT4qCweKpLN9gXfeX9/r/iDwQAUyr62JgGRbwHcpSsoam0qUszseFeHwId5N0t9c/5 CGQaHCjFN1W/66Ev4wv1hHk0qz9W9NFWug36zJiEmdLFh0Zr4ZKIn4bQzOMip8vcMRO9 VTYQ== X-Gm-Message-State: AC+VfDxZZ7CZSRG8DTiUjwNOgvXtGRmtVECSV2iNo16gckx7Z6aN+qjD sne3BUKwuDRsk22ioGb0YbTfS0cqSYdqdIFGAylmM/ae1NDZkgySyFQ= X-Google-Smtp-Source: ACHHUZ6rA8MXYnOd/Qa6qNXjX8cl6tEajM2N2E2ScCe9z9mxyqW0fjcBvIFi5S7yBwKq4h1h67fKaaWIhEaXFCEpefY= X-Received: by 2002:a81:4993:0:b0:561:e7bb:1b27 with SMTP id w141-20020a814993000000b00561e7bb1b27mr9778988ywa.52.1685685188954; Thu, 01 Jun 2023 22:53:08 -0700 (PDT) MIME-Version: 1.0 References: <87edmupgkl.fsf@oldenburg.str.redhat.com> In-Reply-To: <87edmupgkl.fsf@oldenburg.str.redhat.com> From: Jayakrishna Vadayath Date: Thu, 1 Jun 2023 22:52:56 -0700 Message-ID: Subject: Re: Implementation of strtok To: Florian Weimer Cc: Jayakrishna Vadayath via Libc-alpha Content-Type: multipart/alternative; boundary="000000000000e4217e05fd1f2a08" X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,HTML_MESSAGE,KAM_DMARC_NONE,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000e4217e05fd1f2a08 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=E2=80=AFPM Florian Weimer = 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 > > --=20 Regards Jayakrishna Menon --000000000000e4217e05fd1f2a08--