Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

or sizeof(dst), and not forgetting dst[sizeof(dst)-1]='\0';


That's why strlcpy is safer than strncpy, it makes sure that the destination string will always be zero-terminated.




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

Search: