mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-03 09:56:38 -05:00
rpc: Check that left section is not multiline
This commit is contained in:
parent
f32f7e907a
commit
fa8ec00061
1 changed files with 3 additions and 0 deletions
|
@ -381,6 +381,9 @@ struct Sections {
|
||||||
std::string ret;
|
std::string ret;
|
||||||
const size_t pad = m_max_pad + 4;
|
const size_t pad = m_max_pad + 4;
|
||||||
for (const auto& s : m_sections) {
|
for (const auto& s : m_sections) {
|
||||||
|
// The left part of a section is assumed to be a single line, usually it is the name of the JSON struct or a
|
||||||
|
// brace like {, }, [, or ]
|
||||||
|
CHECK_NONFATAL(s.m_left.find('\n') == std::string::npos);
|
||||||
if (s.m_right.empty()) {
|
if (s.m_right.empty()) {
|
||||||
ret += s.m_left;
|
ret += s.m_left;
|
||||||
ret += "\n";
|
ret += "\n";
|
||||||
|
|
Loading…
Add table
Reference in a new issue