Addressed reviewer's comments.

This commit is contained in:
Markus Blatt 2019-10-18 16:21:02 +02:00
parent 0bc1630cc9
commit 42247105bf

View File

@ -486,11 +486,10 @@ void unpack(std::string& str, std::vector<char>& buffer, int& position,
{
std::size_t length=0;
unpack(length, buffer, position, comm);
char* cStr = new char[length];
unpack(cStr, length, buffer, position, comm);
std::vector<char> cStr(length, '\0');
unpack(cStr.data(), length, buffer, position, comm);
assert(str.empty());
str.append(cStr);
delete[] cStr;
str.append(cStr.data());
}
template<class T1, class T2>