0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-18 07:50:57 +01:00

ircd::buffer: Fix bug.

This commit is contained in:
Jason Volk 2017-11-17 23:38:39 -08:00
parent 69f05391a6
commit 81c3a87ee5

View file

@ -572,8 +572,9 @@ ircd::buffer::copy(it &dest,
{ {
const it ret{dest}; const it ret{dest};
const size_t remain(stop - dest); const size_t remain(stop - dest);
dest += std::min(size(src), remain); const size_t cpsz{std::min(size(src), remain)};
memcpy(ret, data(src), dest - ret); memcpy(ret, data(src), cpsz);
dest += cpsz;
return ret; return ret;
} }