mirror of
https://github.com/matrix-construct/construct
synced 2024-10-04 14:48:56 +02:00
ircd::util: Assert the stream didn't overflow our buffer.
This commit is contained in:
parent
048ecf07bb
commit
05fcdd458a
1 changed files with 4 additions and 1 deletions
|
@ -270,10 +270,13 @@ view(stringstream &ss,
|
||||||
assert(size_t(ss.tellp()) <= size(buf));
|
assert(size_t(ss.tellp()) <= size(buf));
|
||||||
ss.flush();
|
ss.flush();
|
||||||
ss.rdbuf()->pubsync();
|
ss.rdbuf()->pubsync();
|
||||||
return
|
const string_view ret
|
||||||
{
|
{
|
||||||
data(buf), size_t(ss.tellp())
|
data(buf), size_t(ss.tellp())
|
||||||
};
|
};
|
||||||
|
|
||||||
|
assert(size(ret) <= size(buf));
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue