fixed assert triggered by checked iterators in msvc-8.0

This commit is contained in:
Arvid Norberg 2007-05-16 01:58:00 +00:00
parent 1d68e10684
commit f7d051162e
1 changed files with 2 additions and 1 deletions

View File

@ -549,7 +549,8 @@ namespace libtorrent
, recv_buffer.left()), int(range_end - range_start - m_received_body));
assert(copy_size >= 0);
m_piece.resize(piece_size + copy_size);
std::memcpy(&m_piece[0] + piece_size, recv_buffer.begin, copy_size);
if (copy_size > 0)
std::memcpy(&m_piece[0] + piece_size, recv_buffer.begin, copy_size);
recv_buffer.begin += copy_size;
m_received_body += copy_size;
m_body_start += copy_size;