[Info-vax] ChatGPT solved it for me, again...

bill bill.gunshannon at gmail.com
Fri Feb 17 10:44:59 EST 2023


On 2/17/2023 9:16 AM, Simon Clubley wrote:
> On 2023-02-17, Arne Vajhøj <arne at vajhoej.dk> wrote:
>>
>> strcspn will stop when it reach the terminating null byte.
>>
> 
> Are you sure about that ?
> 
> https://linux.die.net/man/3/strcspn
> 
> There's no mention of stopping at a null and no mention of what the
> return value is when the byte is not found within the string if it
> were to stop at a terminating null.

Then either the Linux manpage is deficient or the routine is broken.

 From a BSD man:

      The strcspn() function spans the initial part of the nul-terminated
      string s as long as the characters from s do not occur in string
      charset (it spans the complement of charset).

Or we have a problem of conflicting standards.  :-)


bill




More information about the Info-vax mailing list