From 542b3e920eaaa0fae9d58968f49051fe5e6df765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sun, 31 Dec 2023 13:24:36 +0100 Subject: [PATCH] Fixed read error check --- src/map/tar.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/map/tar.cpp b/src/map/tar.cpp index 897c11b2..1fcb8a52 100644 --- a/src/map/tar.cpp +++ b/src/map/tar.cpp @@ -70,11 +70,11 @@ bool Tar::loadTar() quint64 size; qint64 ret; - while ((ret = _file.read(buffer, BLOCKSIZE)) > 0) { + while ((ret = _file.read(buffer, BLOCKSIZE))) { if (ret < BLOCKSIZE) { _file.close(); _index.clear(); - _errorString = "Error reading header block"; + _errorString = "Error reading TAR header block"; return false; } size = number(hdr->size, sizeof(hdr->size)); @@ -100,7 +100,7 @@ bool Tar::loadTmi(const QString &path) return false; while (!file.atEnd()) { - QByteArray line = file.readLine(4096); + QByteArray line(file.readLine(4096)); int pos = line.indexOf(':'); if (line.size() < 10 || pos < 7 || !line.startsWith("block")) { qWarning("%s:%d: syntax error", qPrintable(path), ln);