Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
saagarjha
on Oct 28, 2019
|
parent
|
context
|
favorite
| on:
Ask HN: What is the most beautiful piece of code y...
Watch out: what strncpy does is usually
not
what you'd want it to do.
shawxe
on Oct 28, 2019
[–]
That's what strlcpy() is for.
saagarjha
on Oct 28, 2019
|
parent
[–]
Or strncpy, if you'd like to stay within the standard and your strings are small.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: