The issue was in using with `strncpy` a size of source array instead of using a size of destination array.