diff options
Diffstat (limited to 'backend/String.cpp')
-rw-r--r-- | backend/String.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/backend/String.cpp b/backend/String.cpp index e5512bf..84dc2ec 100644 --- a/backend/String.cpp +++ b/backend/String.cpp @@ -26,7 +26,7 @@ String::String(String && other) { } String & String::operator = (String && other) { if (this == &other) return *this; - safe_free(this->_data); + safe_free(&this->_data); this->_data = other._data; this->_data_len = other._data_len; other._data = nullptr; @@ -58,14 +58,14 @@ String String::va_fmt(va_list args, const char * fmt) { out._data_len = vsnprintf(NULL, 0, fmt, args_copy); va_end(args_copy); - safe_free(out._data); + safe_free(&out._data); out._data = static_cast<char *>(malloc(out._data_len + 1)); vsnprintf(out._data, out._data_len + 1, fmt, args); return out; } String::~String() { - safe_free(this->_data); + safe_free(&this->_data); } void String::set(const char * data) { @@ -73,7 +73,7 @@ void String::set(const char * data) { } void String::set(const char * data, size_t data_len) { - safe_free(this->_data); + safe_free(&this->_data); this->_data = static_cast<char *>(malloc(data_len + 1)); this->_data_len = data_len; memcpy(this->_data, data, data_len); |