Ushering out strlcpy()
Ushering out strlcpy()
Posted Aug 30, 2022 7:10 UTC (Tue) by milesrout (subscriber, #126894)In reply to: Ushering out strlcpy() by wtarreau
Parent article: Ushering out strlcpy()
These people should not be programming in C.
"If the length of src is less than n, strncpy() writes additional null bytes to dest to ensure that a total of n bytes are written."
Right there in the man page. If you can't read the most basic documentation, don't use the language!
Posted Aug 30, 2022 14:58 UTC (Tue)
by NYKevin (subscriber, #129325)
[Link] (1 responses)
(Incidentally, snprintf is just about the only portable function that DTRT in this context.)
Posted Aug 30, 2022 14:59 UTC (Tue)
by NYKevin (subscriber, #129325)
[Link]
Ushering out strlcpy()
Ushering out strlcpy()
