Paxos.h: fix dangerouse use of c_str()

No need to use c_str() in get_statename(), simply return a
std::strin instead.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This commit is contained in:
Danny Al-Gaaf 2013-02-25 14:10:20 +01:00
parent 9217c4ac68
commit 350481f90f

View File

@ -191,7 +191,7 @@ public:
* @param s State value.
* @return The state's name.
*/
static const char *get_statename(int s) {
static const string get_statename(int s) {
stringstream ss;
if (s & STATE_RECOVERING) {
ss << "recovering";
@ -211,7 +211,7 @@ public:
if (s & STATE_LOCKED)
ss << " (locked)";
return ss.str().c_str();
return ss.str();
}
private: