mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd::json: Check stringify size on all builds; note valid assert issue.
This commit is contained in:
parent
a79af0e606
commit
e4863aa073
1 changed files with 5 additions and 5 deletions
|
@ -185,7 +185,7 @@ ircd::json::print(char *const &buf,
|
|||
};
|
||||
|
||||
assert(sv.size() < max);
|
||||
assert(valid(sv, std::nothrow));
|
||||
assert(valid(sv, std::nothrow)); //note: false alarm when T=json::member
|
||||
buf[sv.size()] = '\0';
|
||||
return sv.size();
|
||||
}
|
||||
|
@ -207,12 +207,12 @@ ircd::json::strung::strung(T&&... t)
|
|||
print(buf, max, std::forward<T>(t)...)
|
||||
};
|
||||
|
||||
#ifdef RB_DEBUG
|
||||
if(unlikely(printed != ret.size()))
|
||||
std::cerr << printed << " != " << ret.size() << std::endl << ret << std::endl;
|
||||
#endif
|
||||
throw assertive
|
||||
{
|
||||
"%zu != %zu: %s", printed, ret.size(), ret
|
||||
};
|
||||
|
||||
assert(printed == ret.size());
|
||||
return ret;
|
||||
}()}
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue