mirror of
https://github.com/oxen-io/oxen-core.git
synced 2023-12-14 02:22:56 +01:00
wipeable_string: ignore reserve size less than actual size
This was asserting, but stoffu pointed out the std::string standard considers this ok and ignorable
This commit is contained in:
parent
9ec44a2b06
commit
5f801b6adf
1 changed files with 1 additions and 2 deletions
|
@ -85,9 +85,8 @@ void wipeable_string::wipe()
|
|||
void wipeable_string::grow(size_t sz, size_t reserved)
|
||||
{
|
||||
CHECK_AND_ASSERT_THROW_MES(wipefunc, "wipefunc is not set");
|
||||
if (reserved == 0)
|
||||
if (reserved < sz)
|
||||
reserved = sz;
|
||||
CHECK_AND_ASSERT_THROW_MES(reserved >= sz, "reserved < sz");
|
||||
if (reserved <= buffer.capacity())
|
||||
{
|
||||
buffer.resize(sz);
|
||||
|
|
Loading…
Reference in a new issue