There's also an annoying performance problem with strncpy(3).
strncpy(3) 还存在一个恼人的性能问题。
The function strncpy (3) can also be used to copy only a part of the source string into the destination.
函数strncpy(3)还可以用来仅把源字符串的一部分复制到目标中。
Both strncpy (3) and strncat (3) require that you give the amount of space left, not the total size of the buffer.
strncpy(3)和strncat(3)都要求您给出剩余的空间,而不是给出缓冲区的总大小。
应用推荐