From d9fb33e70442de2cd4fe944096c7c81c2342bedb Mon Sep 17 00:00:00 2001 From: Corey Kosak Date: Thu, 9 Jan 2025 15:59:09 -0500 Subject: [PATCH] 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` --- cpp-client/deephaven/dhcore/src/utility/utility.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp-client/deephaven/dhcore/src/utility/utility.cc b/cpp-client/deephaven/dhcore/src/utility/utility.cc index ba0ca75e00c..4ce4e328916 100644 --- a/cpp-client/deephaven/dhcore/src/utility/utility.cc +++ b/cpp-client/deephaven/dhcore/src/utility/utility.cc @@ -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; }