gpt4 book ai didi

c - strlcpy 中的 'l' 是什么?

转载 作者:行者123 更新时间:2023-12-02 06:57:27 25 4
gpt4 key购买 nike

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com