mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
kdbx-extract: Don't abort if parsing the XML data fails.
This commit is contained in:
parent
ac56ac98f7
commit
e92981b476
@ -65,13 +65,20 @@ int main(int argc, char **argv)
|
|||||||
reader.setSaveXml(true);
|
reader.setSaveXml(true);
|
||||||
reader.readDatabase(&dbFile, key);
|
reader.readDatabase(&dbFile, key);
|
||||||
|
|
||||||
|
QByteArray xmlData = reader.xmlData();
|
||||||
|
|
||||||
if (reader.hasError()) {
|
if (reader.hasError()) {
|
||||||
qCritical("Error while reading the database:\n%s", qPrintable(reader.errorString()));
|
if (xmlData.isEmpty()) {
|
||||||
return 1;
|
qCritical("Error while reading the database:\n%s", qPrintable(reader.errorString()));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
qWarning("Error while parsing the database:\n%s\n", qPrintable(reader.errorString()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextStream out(stdout);
|
QTextStream out(stdout);
|
||||||
out << reader.xmlData().constData() << "\n";
|
out << xmlData.constData() << "\n";
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user