summaryrefslogtreecommitdiff
path: root/src/mongo/bson/bsonelement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/bson/bsonelement.cpp')
-rw-r--r--src/mongo/bson/bsonelement.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/bson/bsonelement.cpp b/src/mongo/bson/bsonelement.cpp
index 1191f82ecf2..312eb849caf 100644
--- a/src/mongo/bson/bsonelement.cpp
+++ b/src/mongo/bson/bsonelement.cpp
@@ -873,7 +873,7 @@ void BSONElement::toString(
if (!full && len > 80) {
s << hexblob::encode(data, 70) << "...)";
} else {
- s << hexblob::encode(data, len) << ")";
+ s << hexblob::encode(data, std::max(len, 0)) << ")";
}
} break;