Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/shared/Communication.cpp

Issue 10807006: Use a binary 0 as string separator (Closed)
Patch Set: Created May 24, 2013, 3:22 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/shared/Communication.cpp
===================================================================
--- a/src/shared/Communication.cpp
+++ b/src/shared/Communication.cpp
@@ -29,7 +29,7 @@
// TODO: This is some pretty hacky marshalling, replace it with something more robust
std::string marshalledStrings;
for (std::vector<std::string>::const_iterator it = strings.begin(); it != strings.end(); it++)
- marshalledStrings += *it + ';';
+ marshalledStrings += *it + '\0';
return marshalledStrings;
}
@@ -38,7 +38,7 @@
std::stringstream stream(message);
std::vector<std::string> strings;
std::string string;
- while (std::getline(stream, string, ';'))
+ while (std::getline(stream, string, '\0'))
strings.push_back(string);
return strings;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld