Switch to vector

v1
Brett 2023-02-08 13:16:31 -05:00
parent 54fdeb1ad5
commit e07b631856
1 changed files with 3 additions and 4 deletions

View File

@ -61,10 +61,9 @@ namespace blt::logging {
};
void applyFormatting(const std::string& format, std::string& output, va_list& args){
const char* fmt_c_str = format.c_str();
char formattedChars[1+std::vsnprintf(nullptr, 0, fmt_c_str, args)];
vsprintf(formattedChars, fmt_c_str, args);
output = std::string(formattedChars);
std::vector<char> buf(1+std::vsnprintf(nullptr, 0, format.c_str(), args));
vsprintf(buf.data(), format.c_str(), args);
output = std::string(buf.data());
}
const char* levelColors[6] = {