On Wed, 9 Oct 2024, Alejandro Colomar wrote: > The documentation of an API starts by its prototype. > > void login_prompt(char *name, int len); > void login_prompt(char *name, int size); > > The former should _not_ include a NUL terminator in the argument. > The latter should. If those names are meaningless, there are more > chances of being confused.
You need actual API *documentation*, not just expecting people to guess based on a name. One of those commit messages refers to non-null-terminated utmp structures. I'd say the actual error-prone antipattern seen here is the use of such arrays (fixed width, not necessarily null-terminated) to store things that might otherwise be thought of as strings, rather than anything to do with naming. -- Joseph S. Myers josmy...@redhat.com