Otherwise builds on platforms other than MSVC might be insecure. Use vsnprintf_s with the _TRUNCATE flag instead of vsprintf_s when using MSVC - this truncates the buffer instead of aborting the whole process in case it's too small.