Don't pass pointer into temporary string!
This commit is contained in:
parent
a67f91987e
commit
4ee94f6128
1 changed files with 2 additions and 1 deletions
|
@ -438,7 +438,8 @@ node& node::set_attr_dup(const char* key, const string_span& value)
|
|||
|
||||
node& node::set_attr_int(const char* key, int value)
|
||||
{
|
||||
return set_attr_dup(key, std::to_string(value).c_str());
|
||||
std::string temp = std::to_string(value);
|
||||
return set_attr_dup(key, temp.c_str());
|
||||
}
|
||||
|
||||
node& node::add_child_at(const char* name, size_t index)
|
||||
|
|
Loading…
Add table
Reference in a new issue