mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 00:32:35 +01: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));
|
||||
ss.flush();
|
||||
ss.rdbuf()->pubsync();
|
||||
return
|
||||
const string_view ret
|
||||
{
|
||||
data(buf), size_t(ss.tellp())
|
||||
};
|
||||
|
||||
assert(size(ret) <= size(buf));
|
||||
return ret;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue