X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/206d7d160214aa24cde2adc4dfc25a3b4abba2cd..0c9ba8fe774965e25baca201356dd6da90f9bb5d:/src/mc/AddressSpace.hpp diff --git a/src/mc/AddressSpace.hpp b/src/mc/AddressSpace.hpp index 5c4f51529d..95a938da64 100644 --- a/src/mc/AddressSpace.hpp +++ b/src/mc/AddressSpace.hpp @@ -17,7 +17,7 @@ #include #include "src/mc/mc_forward.hpp" -#include "src/mc/RemotePtr.hpp" +#include "src/mc/remote/RemotePtr.hpp" namespace simgrid { namespace mc { @@ -160,11 +160,10 @@ public: /** Read a string of known size */ std::string read_string(RemotePtr address, std::size_t len) const { - // TODO, use std::vector with .data() in C++17 to avoid useless copies - std::vector buffer(len); - buffer[len] = '\0'; - this->read_bytes(buffer.data(), len, address); - return std::string(buffer.data(), buffer.size()); + std::string res; + res.resize(len); + this->read_bytes(&res[0], len, address); + return res; } };