1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-03-13 10:37:45 +01:00

Be more strict when parsing the TXT files

This commit is contained in:
Martin Tůma 2025-02-26 07:44:33 +01:00
parent 5d1ba90f09
commit 451782ce20

View File

@ -40,14 +40,14 @@ bool TXTParser::parse(QFile *file, QList<TrackData> &tracks,
_errorLine = csv.line() - 1; _errorLine = csv.line() - 1;
return false; return false;
} }
} else if (entry.size() == 13) { } else {
if (!sg) { if (!sg) {
_errorString = "Missing start marker"; _errorString = "Missing start marker";
_errorLine = csv.line() - 1; _errorLine = csv.line() - 1;
return false; return false;
} }
if (entry.at(1) == "A") { if (entry.size() == 13 && entry.at(1) == "A") {
Coordinates c(coordinates(entry)); Coordinates c(coordinates(entry));
if (!c.isValid()) { if (!c.isValid()) {
_errorString = "Invalid coordinates"; _errorString = "Invalid coordinates";