mirror of
https://github.com/nlohmann/json.git
synced 2026-10-15 02:37:13 +00:00
💄 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:
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -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);
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user