💄 fixed a warning

snprintf returns an int, but we later assign it a difference_type which
is usually a long.
This commit is contained in:
Niels Lohmann 2017-02-28 17:24:03 +01:00
parent 224f99070b
commit 059f21aada
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
2 changed files with 2 additions and 2 deletions

View file

@ -6684,7 +6684,7 @@ class basic_json
static constexpr auto d = std::numeric_limits<number_float_t>::digits10;
// the actual conversion
auto written_bytes = snprintf(m_buf.data(), m_buf.size(), "%.*g", d, x);
long written_bytes = snprintf(m_buf.data(), m_buf.size(), "%.*g", d, x);
// negative value indicates an error
assert(written_bytes > 0);

View file

@ -6684,7 +6684,7 @@ class basic_json
static constexpr auto d = std::numeric_limits<number_float_t>::digits10;
// the actual conversion
auto written_bytes = snprintf(m_buf.data(), m_buf.size(), "%.*g", d, x);
long written_bytes = snprintf(m_buf.data(), m_buf.size(), "%.*g", d, x);
// negative value indicates an error
assert(written_bytes > 0);