mirror of
https://github.com/hyprwm/hyprlang.git
synced 2024-12-22 09:59:48 +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;
|
break;
|
||||||
}
|
}
|
||||||
case CONFIGDATATYPE_STR: {
|
case CONFIGDATATYPE_STR: {
|
||||||
if (!m_pData)
|
if (m_pData)
|
||||||
free(m_pData);
|
free(m_pData);
|
||||||
std::string str = std::any_cast<std::string>(ref.data);
|
std::string str = std::any_cast<std::string>(ref.data);
|
||||||
m_pData = calloc(1, str.length() + 1);
|
m_pData = calloc(1, str.length() + 1);
|
||||||
|
@ -131,7 +131,8 @@ void CConfigValue::setFrom(std::any value) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CONFIGDATATYPE_STR: {
|
case CONFIGDATATYPE_STR: {
|
||||||
free(m_pData);
|
if (m_pData)
|
||||||
|
free(m_pData);
|
||||||
std::string str = std::any_cast<std::string>(value);
|
std::string str = std::any_cast<std::string>(value);
|
||||||
m_pData = calloc(1, str.length() + 1);
|
m_pData = calloc(1, str.length() + 1);
|
||||||
strncpy((char*)m_pData, str.c_str(), str.length());
|
strncpy((char*)m_pData, str.c_str(), str.length());
|
||||||
|
|
Loading…
Reference in a new issue