From cf31aebf7bb8e9171e9868b3e7a3a519a1826c76 Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Fri, 23 Mar 2018 16:26:39 +0100 Subject: [PATCH] Fix bugs with custom passwords in Wormhole server --- apps/Wormhole/main.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/Wormhole/main.cpp b/apps/Wormhole/main.cpp index fedc05dcba..a688f80a13 100644 --- a/apps/Wormhole/main.cpp +++ b/apps/Wormhole/main.cpp @@ -93,29 +93,29 @@ int main(int argc, char** argv) { ) ); - if (password == "") { - password = defaultPassword.str(); - LINFO(fmt::format("Connection password: {}", password)); - } - std::string changeHostPassword = ""; commandlineParser.addCommand( std::make_unique>( - password, + changeHostPassword, "--hostpassword", "-h", "Sets the host password to use" ) ); - if (changeHostPassword == "") { - changeHostPassword = defaultChangeHostPassword.str(); - LINFO(fmt::format("Host password: {}", changeHostPassword)); - } - commandlineParser.setCommandLine(arguments); commandlineParser.execute(); + if (password == "") { + password = defaultPassword.str(); + } + if (changeHostPassword == "") { + changeHostPassword = defaultChangeHostPassword.str(); + } + + LINFO(fmt::format("Connection password: {}", password)); + LINFO(fmt::format("Host password: {}", changeHostPassword)); + int port = 25001; if (portString != "") {