Fix wrong size calculation of using strncat