Re: alx-0096r1 - string (and nonstring) copying

Alejandro Colomar <[email protected]> Tue, 28 Jul 2026 17:58:48 +0200
Newsgroups org.kernel.vger.linux-man
Message-ID <amjRQGFh1PvsjJSC@devuan>
Hi Mark,

On 2026-07-28T17:04:20+0200, Alejandro Colomar wrote:
[...]
> > That is, memtostr(str, mem, n), introducing a whole
> > new area of potential confusion that was not present in any existing
> > mem*() or str*() functions.  If reducing potential confusion is that
> > important I would have expected maybe strfrommem(str, mem, n) or
> > similar.
> 
> Hmmmm, interesting suggestion!  That makes it resemble the strfromd(3)
> family, with which it actually has some (minor) relation.  (It might be
> a bit
> 
> strfrommemcat() would be a weird name, because the cat is next to mem
> instead of str.  Should it be strcatfrommem()?

On the other hand, there's precedent in strtol(3) having the arguments
reversed compared to the name.  Programmers are used to having the
destination in the first parameter.

Anyway, I'll mention these alternative names in the proposal.


Cheers,
Alex

-- 
<https://www.alejandro-colomar.es>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmpo0bIACgkQ64mZXMKQ
wqn/fBAAuOem0pa0DweagcDBsTKWL96sCfRPYpDVjXM95vmUegp11rSf0HSqvbYp
Bg58igqwAV9WydHL6V+xqL0vGi/lUZ4QfG8Yfj+sFIOhWlB1TPsFk2vz2HAF4Mbe
fSxPJrsOm8q01i6N6KBCrv/iXd+W+HpSNfMAipq5TO/lOtbKyF5HA1h7xcR6Zy5t
xv2zVjEzoaayIQ4Gqz5kwNRk4Gq8eiQL5cFAO2z2zorz1B1HSvKEfTRquS19U666
NEApSrDuYyKdn7RnbUFkwdmie4B0Yxji7DE5lP6Cq4v7Qv1vs+l6hE6bxLPMz1nL
ZP0UyX84/Xt2k/ULUpAaEeQnPXqUN9co1udTlsxnxkq0ZHvfk1fqNqW443yeDaNS
vkCluFJxJbdkxwLEr1PfuJF5iSt1c3Qwb+HVZbIYj9BAMTUzlOxDuHBvdoBYwbFu
/urCKItbR3p2nhAG+f24bsSFYABAlf6IPLnOgB4cpK+KTmhVB2cqmSNOZrrZoZJa
FLewvpe09URD4QTAp7WgIA3+9KMzsr3Mv16E0C8lz6+kVrMeFxdCGS7Wy3AXUR0m
HrljZ9zgE8oD8E0yNmB0nlbZqbGbIP7JFgo0xSwdewVuHt2dZicg6yNmNb+OEgnj
zzreo8O4FjNotClCOXKt+BLwmVMJhfslvPk5QFerNRl9CPizzsU=
=t+zP
-----END PGP SIGNATURE-----