mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-28 16:59:44 -05: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.readDatabase(&dbFile, key);
|
||||
|
||||
QByteArray xmlData = reader.xmlData();
|
||||
|
||||
if (reader.hasError()) {
|
||||
qCritical("Error while reading the database:\n%s", qPrintable(reader.errorString()));
|
||||
return 1;
|
||||
if (xmlData.isEmpty()) {
|
||||
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);
|
||||
out << reader.xmlData().constData() << "\n";
|
||||
out << xmlData.constData() << "\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user