From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19807 invoked from network); 13 Jul 2021 16:41:09 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 13 Jul 2021 16:41:09 -0000 Received: (qmail 27992 invoked by uid 550); 13 Jul 2021 16:41:07 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 27974 invoked from network); 13 Jul 2021 16:41:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexgo.de; s=vfde-smtpout-mb-15sep; t=1626194455; bh=AIEx95vSit2/+xp2OjFPPJRyoo8ChMcA+/J/7X6C1N4=; h=From:To:Cc:References:In-Reply-To:Subject:Date; b=PZiPDt9yZVuILTJcrxYET7mziKT3RKAo9LzFQDizFHS0O7QC+Q5IIXMZ7VGdawhu7 2YGShC3B982jH7haGOy3AIxohvVstaHFxqOka3bvRpuZ+H/JjpAmwxlyhcqI6K7X0Y iyCQKimBTaowhXsjOBvED1N3+nWYaRiL+luUSHKo= Message-ID: <93626619AB0D496E90CFA1DDAF9915FE@H270> From: "Stefan Kanthak" To: "Rich Felker" Cc: References: <0F84CB3415BB437FBD48B8B81795064E@H270> <20210713154547.GA13220@brightrain.aerifal.cx> In-Reply-To: <20210713154547.GA13220@brightrain.aerifal.cx> Date: Tue, 13 Jul 2021 18:31:12 +0200 Organization: Me, myself & IT MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6002.18197 X-MimeOLE: Produced By Microsoft MimeOLE V6.1.7601.24158 X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 713 X-purgate-ID: 155817::1626194455-00000B26-02690B02/0/0 Subject: Re: [musl] Changes for strcspn(), strspn(), strtok() and strtok_r() Rich Felker wrote: > On Tue, Jul 13, 2021 at 02:02:06PM +0200, Stefan Kanthak wrote: >> #include >> >> char *strtok_r(char *restrict s, const char *restrict sep, char **restrict p) >> { >> if (!s && !(s = *p)) return NULL; >> s += strspn(s, sep); >> - if (!*s) return *p = 0; >> + if (!*s) return *p = NULL; >> *p = s + strcspn(s, sep); >> if (**p) *(*p)++ = 0; >> - else *p = 0; >> + else *p = NULL; >> return s; >> } > > This is a gratuitous style change in the opposite direction of what's > preferred in musl. Do you REALLY prefer using NULL and 0 in parallel for the null pointer? Stefan