Eradicate calls to deprecated sprintf()

This commit is contained in:
Erica Fischer
2023-07-06 12:57:38 -07:00
parent 350d79399f
commit 1c2c07c596
7 changed files with 20 additions and 20 deletions
+1 -1
View File
@@ -481,7 +481,7 @@ static std::string quote(std::string const &s) {
buf.push_back(ch);
} else if (ch < ' ') {
char tmp[7];
sprintf(tmp, "\\u%04x", ch);
snprintf(tmp, sizeof(tmp), "\\u%04x", ch);
buf.append(std::string(tmp));
} else {
buf.push_back(ch);