What is the best alternative to strncpy()?
The function strncpy() doesn't always null terminate so I want to know what is the best alternative that always null terminates? I want a function that if: strlen(src) >= n /*n is the number of characters to be copied from source*/ there's no need to add further code like this: buf[sizeof(buf)-1] = 0;
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.