Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db2ffaa0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Minor refactor to support strings with embedded zeros."

parents b0b0f62c a9e79489
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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) {