mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-09 03:32:29 +00:00
* Added TextElementValue*.
* The curl perform loop wasn't properly checking the returned pointer, which caused a segfault with libcurl 7.15.5. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@754 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -70,19 +70,18 @@ char*
|
||||
TextElementString::copy_string(char* first, const char* last, void* object) {
|
||||
extent_type length = std::min<extent_type>(last - first, m_string.size());
|
||||
|
||||
if (length == 0)
|
||||
return first;
|
||||
|
||||
std::memcpy(first, m_string.c_str(), std::min<extent_type>(length, last - first));
|
||||
std::memcpy(first, m_string.c_str(), length);
|
||||
|
||||
return first + length;
|
||||
}
|
||||
|
||||
char*
|
||||
TextElementCString::copy_string(char* first, const char* last, void* object) {
|
||||
std::memcpy(first, m_string, std::min<extent_type>(m_length, last - first));
|
||||
extent_type length = std::min<extent_type>(last - first, m_length);
|
||||
|
||||
return first + m_length;
|
||||
std::memcpy(first, m_string, length);
|
||||
|
||||
return first + length;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user