Skip to content

Commit d9fb33e

Browse files
authored
fix(cpp-client): use std::getline for reading passwords (#6542)
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`
1 parent 7cfbf1d commit d9fb33e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp-client/deephaven/dhcore/src/utility/utility.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ std::string ObjectId(const std::string &class_short_name, void *this_ptr) {
172172
std::string ReadPasswordFromStdinNoEcho() {
173173
SetStdinEcho(false);
174174
std::string password;
175-
std::cin >> password;
175+
std::getline(std::cin, password);
176176
SetStdinEcho(true);
177177
return password;
178178
}

0 commit comments

Comments
 (0)