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

Commit 9b005a32 authored by Tom Cherry's avatar Tom Cherry Committed by Android Git Automerger
Browse files

am ba0f24c7: am 5573e3d8: Merge "init: replace strdup() in parse_config()"

* commit 'ba0f24c7':
  init: replace strdup() in parse_config()
parents 983cacea ba0f24c7
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -316,10 +316,14 @@ static void parse_config(const char *fn, const std::string& data)

    int nargs = 0;

    //TODO: Use a parser with const input and remove this copy
    std::vector<char> data_copy(data.begin(), data.end());
    data_copy.push_back('\0');

    parse_state state;
    state.filename = fn;
    state.line = 0;
    state.ptr = strdup(data.c_str());  // TODO: fix this code!
    state.ptr = &data_copy[0];
    state.nexttoken = 0;
    state.parse_line = parse_line_no_op;