diff --git a/dlls/engine/CVector.h b/dlls/engine/CVector.h index 05538f53..d6b87eb5 100755 --- a/dlls/engine/CVector.h +++ b/dlls/engine/CVector.h @@ -48,7 +48,8 @@ template class CVector return false; if (m_Data) { - memcpy(newData, m_Data, m_Size * sizeof(T)); + for (size_t i=0; i class CVector return false; if (m_Data) { - memcpy(newData, m_Data, (m_Size < size) ? (m_Size * sizeof(T)) : (size * sizeof(T))); + size_t end = (m_Size < size) ? (m_Size) : size; + for (size_t i=0; i(const CVector & other) { // copy data - m_Data = new T [other.m_Size]; - m_Size = other.m_Size; + m_Data = new T [other.m_CurrentUsedSize]; + m_Size = other.m_CurrentUsedSize; m_CurrentUsedSize = other.m_CurrentUsedSize; - memcpy(m_Data, other.m_Data, m_CurrentUsedSize * sizeof(T)); + for (size_t i=0; i()