Replace sprintf, use unsigned int type and format string
Fix msvc compile error
Fix msvc compile error