fix compile problem for some users due to strncpy