Commit a49409a52c446aa85900ca45a663496b5142208f

Authored by Wiebe Cazemier
1 parent 78996e25

Calculate string length in formatString()

Showing 1 changed file with 2 additions and 1 deletions
utils.cpp
... ... @@ -541,7 +541,8 @@ std::string formatString(const std::string str, ...)
541 541 vsnprintf(buf, 512, str.c_str(), valist);
542 542 va_end(valist);
543 543  
544   - std::string result(buf, 512);
  544 + size_t len = strlen(buf);
  545 + std::string result(buf, len);
545 546  
546 547 return result;
547 548 }
... ...