🏁 adding parentheses around std::snprintf calls #1337
This commit is contained in:
parent
f80efd3954
commit
da81e7be22
4 changed files with 22 additions and 22 deletions
|
@ -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};
|
||||
}
|
||||
|
||||
|
|
|
@ -1360,7 +1360,7 @@ scan_number_done:
|
|||
{
|
||||
// escape control characters
|
||||
char cs[9];
|
||||
snprintf(cs, 9, "<U+%.4X>", static_cast<unsigned char>(c));
|
||||
(std::snprintf)(cs, 9, "<U+%.4X>", static_cast<unsigned char>(c));
|
||||
result += cs;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue