Hi Collin,

On Sat, Jul 05, 2025 at 02:44:02AM +0200, Alejandro Colomar wrote:
> > You can look for yourself here, <https://www.tuhs.org/cgi-bin/utree.pl>.

Hmmm, I've only found definitions, but no uses at all.  All definitions
seem to be there for compatibility with SysV.  I wonder what SysV had
this API for.  I guess it was for some networking code, as the function
seems to be for copying part of a string until a delimiter, and
appending a terminator after it (but including it in the new string).
Something like:

        char  uri[] = "https://www.example.es";;
        char  scheme[countof(uri)];

        p = memccpy(scheme, uri, ':', countof(uri));
        if (p == NULL)
                goto hell;
        p = '\0';

        // Here, scheme is "https:"

This would make sense, although it would be interesting to see the exact
use case they had for it.  I'm pretty certain it was not the use case
that was envisioned by the C Committee when they standardized it in C23.


Cheers,
Alex

-- 
<https://www.alejandro-colomar.es/>

Attachment: signature.asc
Description: PGP signature

Reply via email to