3 ms·
It doesn’t ensure that there’s a null terminator in the resultant string. This may potentially lead to a later overrun when the copied string is read back. (S
by kd5bjo 7y ago
It doesn’t ensure that there’s a null terminator in the resultant string. This may potentially lead to a later overrun when the copied string is read back.
(See also https://linux.die.net/man/3/strncpy https://linux.die.net/man/3/strncpy )