Skip to content

Commit

Permalink
fix(cpp-client): use std::getline for reading passwords (#6542)
Browse files Browse the repository at this point in the history
Previously we were using `std::cin >> s` which has enough unintuitive
behaviors (skipping leading whitespace, stopping at first nonleading
whitespace) that we decided it was better to use `std::getline`
  • Loading branch information
kosak authored Jan 9, 2025
1 parent 7cfbf1d commit d9fb33e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp-client/deephaven/dhcore/src/utility/utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ std::string ObjectId(const std::string &class_short_name, void *this_ptr) {
std::string ReadPasswordFromStdinNoEcho() {
SetStdinEcho(false);
std::string password;
std::cin >> password;
std::getline(std::cin, password);
SetStdinEcho(true);
return password;
}
Expand Down

0 comments on commit d9fb33e

Please sign in to comment.