Use vsprintf_s instead of vsnprintf.