mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-06-17 07:37:13 +02:00
Update POCO to 1.11.0
This commit is contained in:
7
vendor/POCO/Foundation/include/Poco/Buffer.h
vendored
7
vendor/POCO/Foundation/include/Poco/Buffer.h
vendored
@ -159,7 +159,7 @@ public:
|
||||
if (newCapacity > _capacity)
|
||||
{
|
||||
T* ptr = new T[newCapacity];
|
||||
if (preserveContent)
|
||||
if (preserveContent && _ptr)
|
||||
{
|
||||
std::memcpy(ptr, _ptr, _used * sizeof(T));
|
||||
}
|
||||
@ -191,7 +191,7 @@ public:
|
||||
if (newCapacity > 0)
|
||||
{
|
||||
ptr = new T[newCapacity];
|
||||
if (preserveContent)
|
||||
if (preserveContent && _ptr)
|
||||
{
|
||||
std::size_t newSz = _used < newCapacity ? _used : newCapacity;
|
||||
std::memcpy(ptr, _ptr, newSz * sizeof(T));
|
||||
@ -266,10 +266,11 @@ public:
|
||||
{
|
||||
if (_used == other._used)
|
||||
{
|
||||
if (std::memcmp(_ptr, other._ptr, _used * sizeof(T)) == 0)
|
||||
if (_ptr && other._ptr && std::memcmp(_ptr, other._ptr, _used * sizeof(T)) == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else return _used == 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user