We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 78ffe17 commit e3e9e09Copy full SHA for e3e9e09
src/runtime.cpp
@@ -496,7 +496,7 @@ static std::string json_escape(std::string const& in)
496
// escape and print as unicode codepoint
497
constexpr int printed_unicode_length = 6; // 4 hex + letter 'u' + \0
498
std::array<char, printed_unicode_length> buf;
499
- sprintf(buf.data(), "u%04x", ch);
+ snprintf(buf.data(), buf.size(), "u%04x", ch);
500
out.append(buf.data(), buf.size() - 1); // add only five, discarding the null terminator.
501
break;
502
}
0 commit comments