Linux finally deleted strncpy after six years and 360 patches, and a programmer who saw it born called it 50 years late (phoronix.com)
strncpy was killed for 'counter-intuitive semantics' around NUL termination and wasteful zero-filling. The '360 patches' figure is 360 uses converted to safer calls, not 360 bugs.
The origin: it was written to copy 14-byte, zero-padded-but-not-terminated filenames out of early UNIX directory entries. It was never meant for strings.
Sign in to save