corrected Message::dump

This commit is contained in:
john30
2015-11-22 10:20:42 +01:00
parent b6c24b5c30
commit 89d8167580
+7 -8
View File
@@ -552,7 +552,7 @@ void Message::dump(ostream& output, vector<size_t>* columns)
{ {
bool first = true, all = columns==NULL; bool first = true, all = columns==NULL;
size_t end = all ? 9 : columns->size(); size_t end = all ? 9 : columns->size();
unsigned int cnt = 0; unsigned int index = 0;
for (size_t i=0; i<end; i++) { for (size_t i=0; i<end; i++) {
if (first) { if (first) {
first = false; first = false;
@@ -596,16 +596,15 @@ void Message::dump(ostream& output, vector<size_t>* columns)
break; break;
case 6: // PBSB case 6: // PBSB
case 7: // ID case 7: // ID
cnt = 0; index = 0;
for (vector<unsigned char>::const_iterator it = m_id.begin(); it < m_id.end(); it++) { for (vector<unsigned char>::const_iterator it = m_id.begin(); it < m_id.end(); it++, index++) {
cnt++; if (column == 7 && index <= 1) {
if (column == 6) {
if (cnt == 2)
break;
} else if (cnt < 2) {
continue; continue;
} }
output << hex << setw(2) << setfill('0') << static_cast<unsigned>(*it); output << hex << setw(2) << setfill('0') << static_cast<unsigned>(*it);
if (column == 6 && index >= 1) {
break;
}
} }
break; break;
case 8: // fields case 8: // fields