Changes between Initial Version and Version 1 of Ticket #69571, comment 3


Ignore:
Timestamp:
Apr 4, 2024, 8:27:19 PM (2 months ago)
Author:
fhgwright (Fred Wright)
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #69571, comment 3

    initial v1  
    33The obvious thing to do is to copy Apple's implementation from the later OS versions where they provide them.  It looks like this happened in `Libc-825.24`, and never changed since.  It's a dumb two-pass implementation (as is the GCC version shown above) that fails to avoid the extra overhead that motivated `stpcpy()/stpncpy()` in the first place, but in keeping with the philosophy of never doing anything better than Apple in `legacy-support`, it makes sense.  Thus, the only real benefit over `strcpy()/strncpy()` is in compatibility and convenience.
    44
    5 The larger part of the work is in creating tests, since Apple doesn't have any.  One could argue that adding tests for code coped verbatim from Apple shouldn't really be necessary, but in the interests of completeness, it makes sense to add them.
     5The larger part of the work is in creating tests, since Apple doesn't have any.  One could argue that adding tests for code copied verbatim from Apple shouldn't really be necessary, but in the interests of completeness, it makes sense to add them.