3 ms·
>the strn* versions that required you to manually terminate the string when it hits maximum length This is from the description of the not-easy-to-use strncat(
by cremno 11y ago
>the strn* versions that required you to manually terminate the string when it hits maximum length
This is from the description of the not-easy-to-use strncat():
>A terminating null character is always appended to the result.
So your statement is only true for strncpy(). Unlike many other C functions it doesn't deal with C strings (null-terminated character arrays), but rather with fixed length and possibly null padded character arrays. People are just misusing it for some false sense of security. It may seem strange but snprintf() is the only secure string copy function defined by ISO C99.