The string copying API #strncpy was finally removed from #Linux for #LinuxKernel...

@kernellogger@hachyderm.io

The string copying API #strncpy was finally removed from #Linux for #LinuxKernel 7.2 via these changes submitted by @kees:

git.kernel.org/torvalds/c/1a37

He also removed the fuction itself:

git.kernel.org/torvalds/c/079a

To quote: ""strncpy() has been a persistent source of bugs due to its ambiguous intended usage and frequently counter-intuitive semantics: it may not NUL-terminate the destination, and it unconditionally zero-pads to the full length, which isn't always needed. All former callers have been migrated to: […] github.com/KSPP/linux/issues/90"

For some of the problems of this API, see the following great @lwn articles:

* strscpy() and the hazards of improved interfaces – lwn.net/Articles/659214/
* Ushering out strlcpy() – lwn.net/Articles/905777/
* Better string handling for the kernel – lwn.net/Articles/948408/

#Kernel