fsparser: don't try to analyze header after then end of header area

This commit is contained in:
Gwenhael Goavec-Merou 2021-06-18 13:33:40 +02:00
parent 41b4a79af1
commit b4fe045060
1 changed files with 5 additions and 0 deletions

View File

@ -50,6 +50,7 @@ int FsParser::parseHeader()
int ret = 0;
string buffer;
int line_index = 0;
bool in_header = true;
istringstream lineStream(_raw_data);
@ -67,6 +68,9 @@ int FsParser::parseHeader()
*/
_lstRawData.push_back(buffer);
if (!in_header)
continue;
uint8_t c = bitToVal(buffer.substr(0, 8).c_str(), 8);
uint8_t key = c & 0x7F;
uint64_t val = bitToVal(buffer.c_str(), buffer.size());
@ -112,6 +116,7 @@ int FsParser::parseHeader()
break;
case 0x3B: /* last header line with crc and cfg data length */
/* documentation issue */
in_header = false;
uint8_t crc;
crc = 0x01 & (val >> 23);