use snprintf instead of strcpy,strncpy