mirror of
https://github.com/matrix-construct/construct
synced 2024-05-29 00:03:45 +02:00
ircd::util: Fix clamp for negative stream::tellp() to view empty.
This commit is contained in:
parent
fe0f398e14
commit
8387459369
|
@ -92,10 +92,15 @@ inline string_view
|
|||
view(stringstream &ss,
|
||||
const const_buffer &buf)
|
||||
{
|
||||
const auto tell
|
||||
{
|
||||
std::min(size_t(ss.tellp()), size(buf))
|
||||
};
|
||||
const size_t tell
|
||||
(
|
||||
std::clamp
|
||||
(
|
||||
ssize_t(ss.tellp()),
|
||||
ssize_t(0),
|
||||
ssize_t(size(buf))
|
||||
)
|
||||
);
|
||||
|
||||
ss.flush();
|
||||
ss.rdbuf()->pubsync();
|
||||
|
|
Loading…
Reference in a new issue