Search code examples
cbsdc-strings

What is the 'l' for in strlcpy?


What does the 'l' in strlcpy stand for? I'm certain after asking it will be horribly obvious but I can't seem to dredge up a solid answer anywhere.


Solution

  • strlcpy was introduced at USENIX 1999 by Todd C. Miller and Theo de Raadt (OpenBSD project).

    From the Proceedings paper, strlcpy and strlcat — Consistent, Safe, String Copy and Concatenation, in the abstract it is written:

    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

    It is therefore pretty obvious the l stands for length.