Skip to content

Commit

Permalink
Replace in.readLine() with Utils::getPassword()
Browse files Browse the repository at this point in the history
Fixes #1673.
  • Loading branch information
a-dma committed Mar 9, 2018
1 parent 46e8e3d commit c223969
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include "gui/MainWindow.h"
#include "gui/MessageBox.h"

#include "cli/Utils.h"

#if defined(WITH_ASAN) && defined(WITH_LSAN)
#include <sanitizer/lsan_interface.h>
#endif
Expand Down Expand Up @@ -148,7 +150,9 @@ int main(int argc, char** argv)
// we always need consume a line of STDIN if --pw-stdin is set to clear out the
// buffer for native messaging, even if the specified file does not exist
static QTextStream in(stdin, QIODevice::ReadOnly);
password = in.readLine();
static QTextStream out(stdout, QIODevice::WriteOnly);
out << QCoreApplication::translate("Main", "Database password: ") << flush;
password = Utils::getPassword();
}

if (!filename.isEmpty() && QFile::exists(filename) && !filename.endsWith(".json", Qt::CaseInsensitive)) {
Expand Down

0 comments on commit c223969

Please sign in to comment.