One big problem of strncpy, it doesn't allow you control the behaviour when overflow... http://blog.liw.fi/posts/strncpy/ Problem of atoi - http://www.lainoox.com/ascii-to-integer-atoi-in-c/