3 std::string
StrPrintfV(const char *format
, va_list args
)
5 std::string
out(15, '#'); // 15 is maximum number of characters when SSO still being used
8 va_copy(args_copy
, args
);
9 int rv
= vsnprintf(&out
[0], out
.size(), format
, args_copy
);
12 if (rv
>= 0 && rv
< (int)out
.size()) {
18 rv
= vsnprintf(&out
[0], out
.size(), format
, args
);
20 if (rv
>= 0 && rv
< (int)out
.size()) {
25 out
= "Bad format string: ";
30 std::string
StrPrintf(const char *format
, ...)
33 va_start(args
, format
);
35 const std::string
&out
= StrPrintfV(format
, args
);