Messages in this thread | | | Date | Wed, 7 Feb 2024 18:51:45 +0100 | From | Pavel Machek <> | Subject | Re: [RFC] string: Allow 2-argument strscpy() |
| |
Hi!
> > Using sizeof(dst) is the overwhelmingly common case for strscpy(). > > Instead of requiring this everywhere, allow a 2-argument version to be > > used that will use the sizeof() internally. > > Yeah, this is definitely the case. I have a ton of patches replacing > strncpy with strscpy [1] and many of them match the pattern of: > | strscpy(dest, src, sizeof(dest)) > > BTW, this hack for function overloading is insane. Never really looked into > it before.
This hack is insane, but this is also highly confusing, please don't do this.
BR, Pavel -- People of Russia, stop Putin before his war on Ukraine escalates. [unhandled content-type:application/pgp-signature] | |