1
0
mirror of https://github.com/nlohmann/json.git synced 2025-08-07 18:02:57 +03:00

🏁 adding parentheses around std::snprintf calls #1337

This commit is contained in:
Niels Lohmann
2018-11-09 21:18:02 +01:00
parent f80efd3954
commit da81e7be22
4 changed files with 22 additions and 22 deletions

View File

@@ -264,7 +264,7 @@ class binary_reader
default: // anything else not supported (yet)
{
char cr[3];
snprintf(cr, sizeof(cr), "%.2hhX", static_cast<unsigned char>(element_type));
(std::snprintf)(cr, sizeof(cr), "%.2hhX", static_cast<unsigned char>(element_type));
return sax->parse_error(element_type_parse_position, std::string(cr), parse_error::create(114, element_type_parse_position, "Unsupported BSON record type 0x" + std::string(cr)));
}
}
@@ -1921,7 +1921,7 @@ class binary_reader
std::string get_token_string() const
{
char cr[3];
snprintf(cr, 3, "%.2hhX", static_cast<unsigned char>(current));
(std::snprintf)(cr, 3, "%.2hhX", static_cast<unsigned char>(current));
return std::string{cr};
}