1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-03-25 07:48:26 +01:00

Fixed error handling

This commit is contained in:
Martin Tůma 2025-03-21 05:56:17 +01:00
parent bca335d4b2
commit e9a8112196

View File

@ -180,12 +180,15 @@ bool VTKParser::parse(QFile *file, QList<TrackData> &tracks,
_errorString = ""; _errorString = "";
while (true) { while (true) {
len = file->read((char*)&recordLen, 2); if ((len = file->read((char*)&recordLen, sizeof(recordLen)))
if (len < 0) { != sizeof(recordLen)) {
_errorString = "I/O error"; if (!len)
return false; break;
} else if (len == 0) else {
break; _errorString = "Error reading VTK record size";
return false;
}
}
recordLen = qFromLittleEndian(recordLen); recordLen = qFromLittleEndian(recordLen);
ba.resize(recordLen); ba.resize(recordLen);