mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd::json: Ensure space for null string terminator in print().
This commit is contained in:
parent
6e7751eaf3
commit
2a539cb22c
1 changed files with 6 additions and 1 deletions
|
@ -125,9 +125,14 @@ ircd::json::print(const mutable_buffer &buf,
|
|||
if(unlikely(!size(buf)))
|
||||
return 0;
|
||||
|
||||
mutable_buffer out
|
||||
{
|
||||
data(buf), size(buf) - 1
|
||||
};
|
||||
|
||||
const auto sv
|
||||
{
|
||||
stringify(mutable_buffer{buf}, std::forward<T>(t)...)
|
||||
stringify(out, std::forward<T>(t)...)
|
||||
};
|
||||
|
||||
assert(sv.size() < size(buf));
|
||||
|
|
Loading…
Reference in a new issue