Many functions in C have been "improved" with versions that have n, l, or other characters in their names. For instance, strncat and strlcat which improves strcat. What is the significance of the letter n or l in these names?
What is the significance of the letter n or l in these names?
The "n" means that the operation is bound by a character limit, with the limit being remaining available space in the destination (in the case of strncpy() and strncat()), or a partial string count (in the case of strncmp()).
I don't know the etymology of the "l" (note that the strl* functions are non-standard), but like the "n", it means that a character limit is provided to avoid buffer overflow. However, instead of the limit representing remaining available space in the destination, it represents the total size of the buffer, which greatly simplifies usage.