2 ms·
Yeah I think strlcpy is way better exactly for this reason. I'm sure the idea behind returning the pointer was call chaining, but you shouldn't ever be doing t
by camgunz 7y ago
Yeah I think strlcpy is way better exactly for this reason. I'm sure the idea behind returning the pointer was call chaining, but you shouldn't ever be doing that anyway, and with strlcpy you basically can't do an off-by-one.
- dwheeler 7y agoIt's true that strlcpy is easier to use. One challenge is that strlcpy always reads its inputs to completion, even when it is not needed to make the copy, because it has to compute the total length of the screen ignoring limits. In some circumstances that is a problem.