From 8a44b7d2906cb84e9311ff1fd858c7d20a9ddea2 Mon Sep 17 00:00:00 2001 From: Jiri Luznicky Date: Tue, 1 Dec 2015 22:31:39 +0100 Subject: [PATCH] Bad line count when incorrect line in mapfile is skipped. --- src/maplist.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/maplist.cpp b/src/maplist.cpp index 6bca5e03..63b821a6 100644 --- a/src/maplist.cpp +++ b/src/maplist.cpp @@ -19,8 +19,9 @@ QList MapList::load(const QString &fileName) return mapList; } - int ln = 1; + int ln = 0; while (!file.atEnd()) { + ln++; QByteArray line = file.readLine(); QList list = line.split('\t'); if (list.size() != 2) { @@ -33,8 +34,6 @@ QList MapList::load(const QString &fileName) mapList.append(new Map(QString::fromUtf8(ba1.data(), ba1.size()), QString::fromLatin1(ba2.data(), ba2.size()))); - - ln++; } return mapList;