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
@@ -114,7 +114,7 @@ std::string sort_quote(const char *s) {
for (size_t i = 0; i < utf32.size(); i++) {
if (utf32[i] < 0xD800) {
char buf[8];
sprintf(buf, "\\u%04lu", utf32[i]);
snprintf(buf, sizeof(buf), "\\u%04lu", utf32[i]);
ret.append(std::string(buf));
} else {
unsigned long c = utf32[i];