[ox/model] Add support to SerStr for allocating string

This commit is contained in:
2020-04-16 22:21:59 -05:00
parent 8753d39b66
commit b3fa531aa0
5 changed files with 45 additions and 8 deletions

View File

@@ -68,7 +68,7 @@ Error MetalClawWriter::field(const char*, bool *val) noexcept {
Error MetalClawWriter::field(const char*, SerStr val) noexcept {
bool fieldSet = false;
if (val.cap() && (m_unionIdx == -1 || m_unionIdx == m_field)) {
if (val.len() && (m_unionIdx == -1 || m_unionIdx == m_field)) {
// write the length
const auto strLen = mc::encodeInteger(val.len());
if (m_buffIt + strLen.length + val.len() < m_buffLen) {