Skip to content
Snippets Groups Projects
Commit 7ca2f585 authored by Ansgar Burchardt's avatar Ansgar Burchardt Committed by Carsten Gräser
Browse files

[bugfix] Move "buffer" variable to automatic storage.


This change should make formatString safe to use in multi-threaded
programs.

This fixes FS#1636.

(cherry picked from commit f529d23f)
Signed-off-by: default avatarCarsten Gräser <graeser@dune-project.org>
parent 450ac7d0
No related branches found
No related tags found
No related merge requests found
......@@ -72,7 +72,7 @@ namespace Dune {
static std::string formatString(const std::string& s, const T&... args)
{
static const int bufferSize=1000;
static char buffer[bufferSize];
char buffer[bufferSize];
// try to format with static buffer
int r = std::snprintf(buffer, bufferSize, s.c_str(), args...);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment