summaryrefslogtreecommitdiff
path: root/src/mongo/util/itoa.h
diff options
context:
space:
mode:
authorWaley Chen <waleycz@gmail.com>2016-07-20 17:07:55 -0400
committerWaley Chen <waleycz@gmail.com>2016-07-20 17:07:55 -0400
commit4f763e1509ab88aef9c9e7db45d9699f94382bf2 (patch)
tree9927b1b779c2fa5692777a0e56eb442245acf50b /src/mongo/util/itoa.h
parentf3aebd17867f7e36b6c671fccf3adc0e20531afb (diff)
downloadmongo-4f763e1509ab88aef9c9e7db45d9699f94382bf2.tar.gz
SERVER-21554 Coverity analysis defect 76764: Macro compares unsigned to 0
Diffstat (limited to 'src/mongo/util/itoa.h')
-rw-r--r--src/mongo/util/itoa.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/util/itoa.h b/src/mongo/util/itoa.h
index 7d02f82400c..cbf046e4dda 100644
--- a/src/mongo/util/itoa.h
+++ b/src/mongo/util/itoa.h
@@ -41,6 +41,8 @@ class ItoA {
MONGO_DISALLOW_COPYING(ItoA);
public:
+ static constexpr size_t kBufSize = 11;
+
explicit ItoA(std::uint32_t i);
operator StringData() {
@@ -50,8 +52,8 @@ public:
private:
const char* _str{nullptr};
std::size_t _len{0};
- // 11 is provably the max size we need as int32_t max has 10 digits.
- char _buf[11];
+ // 11 is provably the max size we need as uint32_t max has 10 digits.
+ char _buf[kBufSize];
};
} // namespace mongo