-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
In library Foundation, Have some bugs in Buffer.h
145 std::memcpy(ptr, _ptr, _used);
should be:
std::memcpy(ptr, _ptr, _used * sizeof(T));
173 if (preserveContent)
174 std::memcpy(ptr, _ptr, _used < newCapacity ? _used : newCapacity);
should be:
if (preserveContent)
{
std::size_t newSz = _used < newCapacity ? _used : newCapacity;
std::memcpy(ptr, _ptr, newSz * sizeof(T));
}
190 std::memcpy(_ptr, buf, sz);
should be:
std::memcpy(_ptr, buf, sz * sizeof(T));
199 std::memcpy(_ptr + _used - sz, buf, sz);
should be:
199 std::memcpy(_ptr + _used - sz, buf, sz * sizeof(T));
244 if (std::memcmp(_ptr, other._ptr, _used) == 0)
should be:
if (std::memcmp(_ptr, other._ptr, _used * sizeof(T)) == 0)
There's all.