Safely using strncpy
This tip submitted by oliv29 on 2006-04-16 17:28:23. It has been viewed 13799 times.
Rating of 6.5 with 106 votes
when you use strncpy() always remember to add '\0' at the end of destination string. strncpy does not automatically add the terminator if the source string is longer than the destination!
More tips
Help your fellow programmers! Add a tip!