Fix parser to work with empty lines after EOF

An exception (data after EOF) was thrown everytime a empty line appears after the EOF record.

Some Intel Hex files do have an extra blank line which couldn't be used with this parser.

Appling this fix, the parser will ignore the record if it's an empty line.
This commit is contained in:
Ian Koerich Maciel 2018-05-25 17:11:39 -03:00
parent ba89a9a6e0
commit ee4a0b93b4
1 changed files with 4 additions and 0 deletions

View File

@ -217,6 +217,10 @@ public class Parser {
String recordStr;
while ((recordStr = reader.readLine()) != null) {
// Ignore if this is a blank line.
if (recordStr.isEmpty()) {
continue;
}
Record record = parseRecord(recordStr);
processRecord(record);
recordIdx++;