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

* commit '5573e3d839c25321bafe4390d03d0c1853cf5539':
  init: replace strdup() in parse_config()
This commit is contained in:
Tom Cherry 2015-08-11 20:59:40 +00:00 committed by Android Git Automerger
commit ba0f24c717
1 changed files with 5 additions and 1 deletions

View File

@ -315,10 +315,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;