Merge "Minor refactor to support strings with embedded zeros." am: db2ffaa0f0 am: 417119922f
am: 87910a986a
Change-Id: I9b19879de6f3822746fee46d4d4294b4a3e23f9e
This commit is contained in:
commit
53e5e06b2d
1 changed files with 2 additions and 1 deletions
|
|
@ -38,7 +38,8 @@ bool SendProtocolString(int fd, const std::string& s) {
|
|||
|
||||
// The cost of sending two strings outweighs the cost of formatting.
|
||||
// "adb sync" performance is affected by this.
|
||||
return WriteFdFmt(fd, "%04x%.*s", length, length, s.c_str());
|
||||
auto str = android::base::StringPrintf("%04x", length).append(s);
|
||||
return WriteFdExactly(fd, str);
|
||||
}
|
||||
|
||||
bool ReadProtocolString(int fd, std::string* s, std::string* error) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue