diff options
author | Mathias Stearn <mathias@10gen.com> | 2013-07-24 16:43:32 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2013-07-24 16:49:27 -0400 |
commit | 52ab34807bc0887e62bc3df2ed959cd7dd4f6d08 (patch) | |
tree | bb7e641cc30f18b2006478331beac9fb4685a5be /src/mongo/bson/bsonelement.h | |
parent | 9b4367bfc32e2e937da154e87db6e97fb2509b46 (diff) | |
download | mongo-52ab34807bc0887e62bc3df2ed959cd7dd4f6d08.tar.gz |
Don't truncate strings at NUL byte in BSONElement::String()
Diffstat (limited to 'src/mongo/bson/bsonelement.h')
-rw-r--r-- | src/mongo/bson/bsonelement.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/bson/bsonelement.h b/src/mongo/bson/bsonelement.h index 11600d01331..753a89d2704 100644 --- a/src/mongo/bson/bsonelement.h +++ b/src/mongo/bson/bsonelement.h @@ -65,7 +65,7 @@ namespace mongo { std::string foo = obj["foo"].String(); // std::exception if not a std::string type or DNE */ - std::string String() const { return chk(mongo::String).valuestr(); } + std::string String() const { return chk(mongo::String).str(); } Date_t Date() const { return chk(mongo::Date).date(); } double Number() const { return chk(isNumber()).number(); } double Double() const { return chk(NumberDouble)._numberDouble(); } |