This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit f2030b7774ec51d4d4939db40815c80aea1ad28c
Author: Andrew Stitcher <[email protected]>
AuthorDate: Wed May 6 17:23:04 2026 -0400

    NO-JIRA: [C++] Make output of binary types prettier
    
    Avoid including formatting (newlines, tabs etc.) in the output for
    binary values.
---
 cpp/src/binary.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpp/src/binary.cpp b/cpp/src/binary.cpp
index fb366f028..353eddeca 100644
--- a/cpp/src/binary.cpp
+++ b/cpp/src/binary.cpp
@@ -32,7 +32,7 @@ std::ostream& operator<<(std::ostream& o, const binary& x) {
     ios_guard restore_flags(o);
     o << std::hex << std::setfill('0') << "b\"";
     for (binary::const_iterator i = x.begin(); i != x.end(); ++i) {
-        if (!isprint(*i) && !isspace(*i)) { // Non-printables in hex.
+        if (!isprint(*i) || isspace(*i)) { // Non-printables and spaces in hex.
             o << "\\x" << std::setw(2) << printable_byte(*i);
         } else {
             o << char(*i);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to