Re:Git's list of banned C functions
by schlupa on Friday March 05, 2021 @10:01AM
(#26357527)
strncpy() suffers from its naming. It never was a string function in reality. It is a function to write and clear a fixed size buffer. It was invented to write filenames in the 14 character buffer of a directory entry in early Unix. It should have been name mem-something and people would have never come to the idea to use it for general string routines.
[ Parent
| on HN ]
Re:Git's list of banned C functions
by JoeAltmaier on Friday March 05, 2021 @10:05AM
(#26357575)
If it respects null terminator, then it is a string function.