diff --git a/src/util/externalcommandhelper.cpp b/src/util/externalcommandhelper.cpp
--- a/src/util/externalcommandhelper.cpp
+++ b/src/util/externalcommandhelper.cpp
@@ -90,7 +90,7 @@
*/
quint64 ExternalCommandHelper::getNonce()
{
- quint64 nonce = m_Generator.generate();
+ const quint64 nonce = m_Generator.generate();
m_Nonces.insert(nonce);
return nonce;
}
@@ -135,6 +135,7 @@
bool ExternalCommandHelper::writeData(const QString &targetDevice, const QByteArray& buffer, qint64 offset)
{
QFile device(targetDevice);
+
if (!device.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Unbuffered)) {
qCritical() << xi18n("Could not open device %1 for writing.", targetDevice);
return false;
@@ -149,6 +150,7 @@
qCritical() << xi18n("Could not write to device %1.", targetDevice);
return false;
}
+
return true;
}