-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace stpcpy()
with strlcpy()
#956
Comments
See also issue #266 where the merits of |
Three of the seven remaining uses of |
I've unassigned myself because most of the existing uses of |
There are seven uses of
stpcpy()
. They result in warnings from the compiler when building on OpenBSD. We now detect if the platform hasstrlcpy()
and if it doesn't provide a fallback implementation. So those uses ofstpcpy()
should be changed to usestrlcpy()
.Yes, I have argued in the past that it doesn't matter whether
stpcpy()
orstrlcpy()
is used as they both require care in their use. They simply have different failure modes. But after some research and thought I concluded thatstrlcpy()
is slightly less dangerous. And there are already plenty of uses ofstrlcpy()
in this project. Better to standardize on that API to minimize potential misunderstandings.The text was updated successfully, but these errors were encountered: