mirror of
https://github.com/monero-project/monero.git
synced 2024-10-01 11:49:47 -04:00
remove new lines at the end of the password only
This commit is contained in:
parent
302cc9c700
commit
7b2d27f89a
@ -812,8 +812,8 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
|
|||||||
std::string password((std::istreambuf_iterator<char>(pfs)),
|
std::string password((std::istreambuf_iterator<char>(pfs)),
|
||||||
(std::istreambuf_iterator<char>()));
|
(std::istreambuf_iterator<char>()));
|
||||||
// Remove line breaks the user might have inserted
|
// Remove line breaks the user might have inserted
|
||||||
password.erase(std::remove(password.begin(), password.end(), '\r'), password.end());
|
password.erase(std::remove(password.begin() - 1, password.end(), '\n'), password.end());
|
||||||
password.erase(std::remove(password.begin(), password.end(), '\n'), password.end());
|
password.erase(std::remove(password.end() - 1, password.end(), '\r'), password.end());
|
||||||
pwd_container.password(password.c_str());
|
pwd_container.password(password.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user