mirror of
https://github.com/ceph/ceph
synced 2025-03-19 17:06:24 +00:00
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:
parent
9217c4ac68
commit
350481f90f
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user