Diffstat (limited to 'noncore/apps/opie-reader/CBuffer.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/CBuffer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/apps/opie-reader/CBuffer.cpp b/noncore/apps/opie-reader/CBuffer.cpp index 0780a88..03d7733 100644 --- a/noncore/apps/opie-reader/CBuffer.cpp +++ b/noncore/apps/opie-reader/CBuffer.cpp @@ -6,16 +6,16 @@ CBufferBase& CBufferBase::assign(const void* sztmp, size_t ms) { delete [] buffer; buffer = new unsigned char[len = ms*membersize]; } - memcpy(buffer, sztmp, ms*membersize); + memcpy(buffer, sztmp, len); return *this; } -CBufferBase::CBufferBase(size_t ms, size_t n) : len(n), membersize(ms) +CBufferBase::CBufferBase(size_t ms, size_t n) : len(n*ms), membersize(ms) { - buffer = new unsigned char[len*membersize]; - memset(buffer, 0, len*membersize); + buffer = new unsigned char[len]; + memset(buffer, 0, len); } void* CBufferBase::operator[](int i) { |