Fixed dangling pointer return in conf_get_int()

This commit is contained in:
RElesgoe 2016-08-24 00:27:07 -07:00
parent 9783e19537
commit c52e1836e7

View file

@ -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)