aboutsummaryrefslogtreecommitdiff
path: root/src/simplewallet
diff options
context:
space:
mode:
authorFabian Hirschmann <fabian@hirschmann.email>2016-01-09 18:59:39 +0100
committerFabian Hirschmann <fabian@hirschmann.email>2016-01-09 18:59:39 +0100
commit7b2d27f89a40cc68976dfb3dd625628dbb6ce7a0 (patch)
treeb9b2b1631670330ea5fecec46eaafa6018eabfb7 /src/simplewallet
parentadd --password-file option (diff)
downloadmonero-7b2d27f89a40cc68976dfb3dd625628dbb6ce7a0.tar.xz
remove new lines at the end of the password only
Diffstat (limited to 'src/simplewallet')
-rw-r--r--src/simplewallet/simplewallet.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index 732148185..2e1337ce0 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -812,8 +812,8 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
std::string password((std::istreambuf_iterator<char>(pfs)),
(std::istreambuf_iterator<char>()));
// 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(), password.end(), '\n'), password.end());
+ password.erase(std::remove(password.begin() - 1, password.end(), '\n'), password.end());
+ password.erase(std::remove(password.end() - 1, password.end(), '\r'), password.end());
pwd_container.password(password.c_str());
}
else