strlcpy
中的“l”代表什么?我敢肯定,在询问之后这将是非常明显的,但我似乎无法在任何地方挖掘出可靠的答案。
最佳答案
strlcpy
由 Todd C. Miller 和 Theo de Raadt(OpenBSD 项目)在 USENIX 1999 上介绍。
来自论文集,strlcpy and strlcat — Consistent, Safe, String Copy and Concatenation ,在摘要中写道:
The proposed replacement functions, strlcpy() and strlcat(), address these problems by presenting an API designed for safe string copies (see Figure 1 for function prototypes). Both functions guarantee NUL-termination, take as a length parameter the size of the string in bytes, and provide an easy way to detect truncation
因此很明显,l
代表长度。
关于c - strlcpy 中的 'l' 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28332854/