strncpy and strncat for copying strings in C

Recently, I've read an interesting article1, explaining why the strncpy function in C is not safer than strcpy. The post was very interesting, but what's more, it suggested an alternative idiom for copying strings in C, that might probably be the way to go.

Later, in another article2 that compared some functionality in C, Python and Go, one of the comments pointed out that very same idiom. That grabbed my attention, so I decided to try it in an example.

Read more...