diff options
author | Riccardo Spagni <ric@spagni.net> | 2018-10-15 13:25:50 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2018-10-15 13:25:50 +0200 |
commit | 40980b33b77a87d846cb1ff632d39766d2d0949f (patch) | |
tree | 571ba5c15815fde8d4d5453e6758c022a0505328 /src | |
parent | Merge pull request #4549 (diff) | |
parent | password: fix secure input with echo on windows (diff) | |
download | monero-40980b33b77a87d846cb1ff632d39766d2d0949f.tar.xz |
Merge pull request #4550
0e33cf89 password: fix secure input with echo on windows (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r-- | src/common/password.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/password.cpp b/src/common/password.cpp index e41c75088..b3c51128f 100644 --- a/src/common/password.cpp +++ b/src/common/password.cpp @@ -60,7 +60,7 @@ namespace DWORD mode_old; ::GetConsoleMode(h_cin, &mode_old); - DWORD mode_new = mode_old & ~((hide_input ? ENABLE_ECHO_INPUT : 0) | ENABLE_LINE_INPUT); + DWORD mode_new = mode_old & ~(hide_input ? ENABLE_ECHO_INPUT : 0); ::SetConsoleMode(h_cin, mode_new); bool r = true; @@ -78,7 +78,11 @@ namespace { break; } - else if (ucs2_ch == L'\n' || ucs2_ch == L'\r') + else if (ucs2_ch == L'\r') + { + continue; + } + else if (ucs2_ch == L'\n') { std::cout << std::endl; break; |