Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 13 Jul 2021 18:31:12 +0200
From: "Stefan Kanthak" <stefan.kanthak@...go.de>
To: "Rich Felker" <dalias@...c.org>
Cc: <musl@...ts.openwall.com>
Subject: Re: 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 <string.h>
>>  
>>  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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.