fsparser: fix checksum with GW1NS-2C, when configuration data is smaller than theory

This commit is contained in:
Gwenhael Goavec-Merou 2021-04-26 19:28:44 +02:00
parent e2b40e1350
commit 200bc6364e
1 changed files with 6 additions and 0 deletions

View File

@ -187,6 +187,12 @@ int FsParser::parse()
nb_line = 0;
}
/* For configuration data checksum: number of lines can't be higher than
* the number indicates in TN653 but may be smaller (seen with the GW1NS-2C).
*/
if (stoi(_hdr["ConfDataLength"]) < nb_line)
nb_line = stoi(_hdr["ConfDataLength"]);
/* drop now useless header */
_lstRawData.erase(_lstRawData.begin(), _lstRawData.begin() + _end_header + 1);
_lstRawData.resize(nb_line);