From 85b2c1f08eeacdd513cad9ce65fb95c971b6f257 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Thu, 6 Jul 2023 14:30:48 +0200 Subject: [PATCH] Write update_log.csv.copy in different format. --- update.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/update.cpp b/update.cpp index 9ab08d3..60b38ee 100644 --- a/update.cpp +++ b/update.cpp @@ -787,15 +787,10 @@ bool Update::doUpdate() { } else { // TODO } - char buf[128]; - memset(buf, 0x00, sizeof(buf)); - snprintf(buf, sizeof(buf)-1, "DONE, %*.*s, %*.*s, %*.*s\n", - 35, 35, name.toStdString().c_str(), - 20, 20, QDateTime::currentDateTime().toString(Qt::ISODate).toStdString().c_str(), - 10, 10, (res == true) ? "SUCCESS" : "ERROR"); - m_update_ctrl_file_copy.write(buf); - - qInfo() << "write" << buf << "into file" << m_update_ctrl_file_copy; + out << "DONE, " << name << ", " + << QDateTime::currentDateTime().toString(Qt::ISODate) << ", " + << ((res == true) ? "SUCCESS" : "ERROR") << "\n"; + out.flush(); } // for (it = openLines.cbegin(); it != openLines.end(); ++it) {