mirror of
https://github.com/hyprwm/hyprlang.git
synced 2024-11-16 18:25:57 +01:00
oops
This commit is contained in:
parent
eb9cdea176
commit
0d38ce0e9e
1 changed files with 3 additions and 2 deletions
|
@ -92,7 +92,7 @@ void CConfigValue::defaultFrom(SConfigDefaultValue& ref) {
|
|||
break;
|
||||
}
|
||||
case CONFIGDATATYPE_STR: {
|
||||
if (!m_pData)
|
||||
if (m_pData)
|
||||
free(m_pData);
|
||||
std::string str = std::any_cast<std::string>(ref.data);
|
||||
m_pData = calloc(1, str.length() + 1);
|
||||
|
@ -131,7 +131,8 @@ void CConfigValue::setFrom(std::any value) {
|
|||
break;
|
||||
}
|
||||
case CONFIGDATATYPE_STR: {
|
||||
free(m_pData);
|
||||
if (m_pData)
|
||||
free(m_pData);
|
||||
std::string str = std::any_cast<std::string>(value);
|
||||
m_pData = calloc(1, str.length() + 1);
|
||||
strncpy((char*)m_pData, str.c_str(), str.length());
|
||||
|
|
Loading…
Reference in a new issue