diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:24:35 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:24:35 +0200 |
commit | 460091fb0b2ff114cc741372f15bb43b702ea3b1 (patch) | |
tree | 0562c2eda4c66969c6e6d0910080db9f5b0def3e /zen/zstring.cpp | |
parent | 5.15 (diff) | |
download | FreeFileSync-460091fb0b2ff114cc741372f15bb43b702ea3b1.tar.gz FreeFileSync-460091fb0b2ff114cc741372f15bb43b702ea3b1.tar.bz2 FreeFileSync-460091fb0b2ff114cc741372f15bb43b702ea3b1.zip |
5.16
Diffstat (limited to 'zen/zstring.cpp')
-rw-r--r-- | zen/zstring.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/zen/zstring.cpp b/zen/zstring.cpp index 262df49e..085e6f72 100644 --- a/zen/zstring.cpp +++ b/zen/zstring.cpp @@ -78,10 +78,8 @@ private: static std::string rawMemToString(const void* ptr, size_t size) { - std::string output(reinterpret_cast<const char*>(ptr), size); - vector_remove_if(output, [](char& c) { return c == 0; }); //remove intermediate 0-termination - if (output.size() > 100) - output.resize(100); + std::string output(reinterpret_cast<const char*>(ptr), std::min<size_t>(size, 100)); + std::replace(output.begin(), output.end(), '\0', ' '); //don't stop at 0-termination return output; } |