From 441c738d0f68e9d32d55255b7dbf11d6491f6726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Tue, 24 Mar 2020 22:06:03 +0100 Subject: [PATCH] Allow IGC files with an A header of size 6 --- src/data/igcparser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/data/igcparser.cpp b/src/data/igcparser.cpp index f25bd125..71f022d9 100644 --- a/src/data/igcparser.cpp +++ b/src/data/igcparser.cpp @@ -87,10 +87,12 @@ static bool readTimestamp(const char *data, QTime &time) static bool readARecord(const char *line, qint64 len) { - if (len < 7 || line[0] != 'A') + /* The minimal A record length should be 7 according to the specification, + but records with length of 6 exist in the wild */ + if (len < 6 || line[0] != 'A') return false; - for (int i = 1; i < 7; i++) + for (int i = 1; i < 6; i++) if (!::isprint(line[i])) return false; return true;