Fix issues with MetalClaw reader iteration too many fields

This commit is contained in:
2017-04-29 08:59:10 -05:00
parent 99c3ca72f5
commit 49bc32abf9
2 changed files with 2 additions and 4 deletions
-2
View File
@@ -72,7 +72,6 @@ int MetalClawReader::op(const char*, ox::bstring<L> *val) {
size_t size = 0;
if (m_buffIt + sizeof(StringLength) < m_buffLen) {
size = ox::std::bigEndianAdapt(*((StringLength*) &m_buff[m_buffIt]));
m_field++;
m_buffIt += sizeof(StringLength);
} else {
err |= MC_BUFFENDED;
@@ -83,7 +82,6 @@ int MetalClawReader::op(const char*, ox::bstring<L> *val) {
if (m_buffIt + size < m_buffLen) {
ox_memcpy(val, &m_buff[m_buffIt], size);
m_buffIt += size;
m_field++;
} else {
err |= MC_BUFFENDED;
}
+2 -2
View File
@@ -19,7 +19,7 @@ using namespace ox;
struct TestStructNest {
bool Bool = false;
int Int = 0;
uint32_t Int = 0;
bstring<32> String = "";
};
@@ -27,7 +27,7 @@ struct TestStruct {
bool Bool = false;
int32_t Int = 0;
bstring<32> String = "";
int List[4] = {0, 0, 0 , 0};
uint32_t List[4] = {0, 0, 0 , 0};
TestStructNest Struct;
};