18 if (!fmt)
return std::string();
20 int result = -1, length = 2048;
24 buffer.resize(length);
29 result = ::vsnprintf_s(&buffer[0], length, _TRUNCATE, fmt, args);
31 result =
::vsnprintf(&buffer[0], length, fmt, args);
36 if (result >= length) result = -1;
42 buffer.resize(result);
std::string format_impl(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
int vsnprintf(char *buf, size_t bufSize, const char *format, va_list args) noexcept
An OS-independent version of vsnprintf (Notice the bufSize param, which may be ignored in some compil...