Hacker News new | past | comments | ask | show | jobs | submit login

> You can use strncpy if you are careful to do it right

That’s like saying if you’re careful to do it right you can use a Bowie knife as a screwdriver.

Technically correct but practically will end in tears. If you’re not working with fixed-size strings (which few are these days) just copy over strscpy, or strlcpy, 5 lines won’t kill you.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: