diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2014-01-21 14:52:44 -0500 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2014-01-21 15:20:26 -0500 |
commit | 58f700145e3f3b2894699900f6d573a488ee3319 (patch) | |
tree | 20f787e092913fdfae1f42ec18b935157aba99ea /src/mongo/util/util.cpp | |
parent | faf2c75e163fc72c37f25725adc39ca1b314b9b5 (diff) | |
download | mongo-58f700145e3f3b2894699900f6d573a488ee3319.tar.gz |
SERVER-11730: Debugging output of connections with unexpected data
Diffstat (limited to 'src/mongo/util/util.cpp')
-rw-r--r-- | src/mongo/util/util.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mongo/util/util.cpp b/src/mongo/util/util.cpp index 937ada5b2c2..3ce159d00c6 100644 --- a/src/mongo/util/util.cpp +++ b/src/mongo/util/util.cpp @@ -34,11 +34,9 @@ namespace mongo { verify( len < 1000000 ); const unsigned char *p = (const unsigned char *) data; stringstream ss; - for( unsigned i = 0; i < 4 && i < len; i++ ) { - ss << std::hex << setw(2) << setfill('0'); - unsigned n = p[i]; - ss << n; - ss << ' '; + ss << std::hex << setw(2) << setfill('0'); + for( unsigned i = 0; i < len; i++ ) { + ss << static_cast<unsigned>(p[i]) << ' '; } string s = ss.str(); return s; |