Fixed dangling pointer return in conf_get_int()
This commit is contained in:
parent
9783e19537
commit
c52e1836e7
1 changed files with 3 additions and 1 deletions
|
@ -89,7 +89,9 @@ namespace pvpgn
|
|||
|
||||
extern const char* conf_get_int(unsigned ival)
|
||||
{
|
||||
return std::to_string(ival).c_str();
|
||||
static char buffer[128] = {};
|
||||
std::snprintf(buffer, sizeof buffer, "%u", ival);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
extern const char* conf_get_bool(unsigned ival)
|
||||
|
|
Loading…
Reference in a new issue