Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
metadat
· 2y ago · 0 comments
Is there an alternate function which should be used instead of strncopy()?
Comments
[–]
outsomnia
2y ago
There are various 'safer' versions of it, a common one is strlcpy() from bsd (which is in glibc etc)
https://linux.die.net/man/3/strlcpy
[–]
metadat
OP
2y ago
That's right, I knew this at some point but haven't been doing much C lately. Thank you for the refresh!