Edit: I\'ve added the source for the example.
I came across this example:
char source[MAX] = \"123456789\";
char source1[MAX] = \"12
strncpy is NOT safer than strcpy, it just trades one type of bugs with another. In C, when handling C strings, you need to know the size of your buffers, there is no way around it. strncpy was justified for the directory thing mentioned by others, but otherwise, you should never use it: