C++ library usage fix: snprintf() may or may not be in std::

This commit is contained in:
Pavel Kirienko
2014-04-02 13:53:39 +04:00
parent cdd0ff3a28
commit 9e91cd1e7c
5 changed files with 16 additions and 11 deletions
+2 -1
View File
@@ -503,7 +503,8 @@ public:
const SizeType max_size = capacity() - size();
// We have one extra byte for the null terminator, hence +1
const int ret = std::snprintf(reinterpret_cast<char*>(ptr), max_size + 1, format, value);
using namespace std; // For snprintf()
const int ret = snprintf(reinterpret_cast<char*>(ptr), max_size + 1, format, value);
for (int i = 0; i < std::min(ret, int(max_size)); i++)
{