[ox] Fix OxFS 2 Directory test

This commit is contained in:
2018-06-06 23:30:57 -05:00
parent ea7cf59ec7
commit a6b9de9a59
11 changed files with 131 additions and 78 deletions

View File

@@ -74,13 +74,13 @@ int MetalClawWriter::op(const char*, ox::BString<L> *val) {
if (val->len()) {
// write the length
typedef uint32_t StringLength;
if (m_buffIt + sizeof(StringLength) + val->size() < m_buffLen) {
*reinterpret_cast<LittleEndian<StringLength>*>(&m_buff[m_buffIt]) = static_cast<StringLength>(val->size());
if (m_buffIt + sizeof(StringLength) + val->bytes() < m_buffLen) {
*reinterpret_cast<LittleEndian<StringLength>*>(&m_buff[m_buffIt]) = static_cast<StringLength>(val->bytes());
m_buffIt += sizeof(StringLength);
// write the string
ox_memcpy(&m_buff[m_buffIt], val, val->size());
m_buffIt += val->size();
ox_memcpy(&m_buff[m_buffIt], val, val->bytes());
m_buffIt += val->bytes();
fieldSet = true;
} else {
err = MC_BUFFENDED;