Avoid returning a pointer to a temporary.

Issue found by cppcheck.
This commit is contained in:
Mark de Wever 2011-03-13 18:59:25 +00:00
parent bec4e9d6c0
commit 187d5ad2ae
2 changed files with 1 additions and 5 deletions

View file

@ -48,10 +48,6 @@ public:
return stream_.str();
}
const char* c_str() {
return str().c_str();
}
private:
std::ostringstream stream_;
};

View file

@ -89,7 +89,7 @@ std::string get_base_filename()
static unsigned counter = 0;
++counter;
return (formatter() << buf << '_' << counter << '_').c_str();
return (formatter() << buf << '_' << counter << '_').str();
}
/***** ***** ***** ***** FLAGS ***** ***** ***** *****/