From e95198e775cba44e168fe817cb906a6da11bc531 Mon Sep 17 00:00:00 2001 From: Christian Hohnstaedt Date: Mon, 9 Apr 2018 05:21:22 +0200 Subject: [PATCH] When overwriting an index.txt file, truncate it. --- lib/db_x509.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/db_x509.cpp b/lib/db_x509.cpp index 7e15d831..03245dbd 100644 --- a/lib/db_x509.cpp +++ b/lib/db_x509.cpp @@ -761,7 +761,7 @@ void db_x509::store(QModelIndexList list) void db_x509::writeIndex(const QString fname, QList items) { QFile file(fname); - file.open(QFile::ReadWrite); + file.open(QFile::ReadWrite | QFile::Truncate); if (file.error()) { throw errorEx(tr("Error opening file: '%1': %2") .arg(fname).arg(strerror(errno)));