aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/src
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2020-04-04 12:42:50 -0500
committerluigi1111 <luigi1111w@gmail.com>2020-04-04 12:42:50 -0500
commit292e2d8f28c0925d62cba81a1f4512724ae73d54 (patch)
treed08cda99279c0fa5ec9fc991aa1ac478372a7980 /contrib/epee/src
parentMerge pull request #6334 (diff)
parentwipeable_string: split - treat CR, LF and Tabs as separators (diff)
downloadmonero-292e2d8f28c0925d62cba81a1f4512724ae73d54.tar.xz
Merge pull request #6335
0078ce7 wipeable_string: split - treat CR, LF and Tabs as separators (xiphon)
Diffstat (limited to 'contrib/epee/src')
-rw-r--r--contrib/epee/src/wipeable_string.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/epee/src/wipeable_string.cpp b/contrib/epee/src/wipeable_string.cpp
index 4209b71bf..4928db172 100644
--- a/contrib/epee/src/wipeable_string.cpp
+++ b/contrib/epee/src/wipeable_string.cpp
@@ -188,13 +188,14 @@ void wipeable_string::split(std::vector<wipeable_string> &fields) const
while (len--)
{
const char c = *ptr++;
- if (c != ' ')
+ const bool space_prev = space;
+ space = std::isspace(c);
+ if (!space)
{
- if (space)
+ if (space_prev)
fields.push_back({});
fields.back().push_back(c);
}
- space = c == ' ';
}
}