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
@ -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 New Issue
Block a user