Skip to content

Commit

Permalink
Merge pull request #3611 from ammatwain/develop
Browse files Browse the repository at this point in the history
Update vrv.cpp
  • Loading branch information
lpugin authored Feb 29, 2024
2 parents 46bc577 + 10c6ef3 commit 34eeaf6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vrv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,14 @@ void EnableLogToBuffer(bool value)

std::string StringFormat(const char *fmt, ...)
{
std::locale previousLocale = std::locale::global(std::locale("C"));
std::string str(STRING_FORMAT_MAX_LEN, 0);
va_list args;
va_start(args, fmt);
vsnprintf(&str[0], STRING_FORMAT_MAX_LEN, fmt, args);
va_end(args);
str.resize(strlen(str.data()));
std::locale::global(previousLocale);
return str;
}

Expand Down

0 comments on commit 34eeaf6

Please sign in to comment.