2 @section @code{strncpy}
5 POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9699919799/functions/strncpy.html}
9 Portability problems fixed by Gnulib:
12 This function cannot be called from plain inline or extern inline functions
17 Portability problems not fixed by Gnulib:
21 Note: This function was designed for the use-case of filling a fixed-size
22 record with a string, before writing it to a file. This function is
23 @strong{not} appropriate for copying a string into a bounded memory area,
24 because you have no guarantee that the result will be NUL-terminated.
25 Even if you add the NUL byte at the end yourself, this function is
26 inefficient (as it spends time clearing unused memory) and will allow
27 silent truncation to occur, which is not a good behavior for GNU programs.
28 For more details, see @url{https://meyering.net/crusade-to-eliminate-strncpy/}.