fix strncpy bug