Hacker News new | ask | show | jobs
by david2ndaccount 686 days ago
Use memcpy and do the size check yourself beforehand (taking the appropriate action if it doesn’t fit). Avoid any function starting with str except for strlen. Prefer pointer+length instead of relying on nul-terminated strings.
1 comments

You mean strnlen.