* 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:
rakshasa
2006-08-10 21:24:10 +00:00
parent ca58b43d8b
commit 3c634730c4
13 changed files with 340 additions and 34 deletions
+5 -6
View File
@@ -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;
}
}