From: Pawel Kaczmarczyk Date: Mon, 17 Sep 2018 07:46:37 +0000 (+0200) Subject: Fixing build error X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen;p=test%2Ftools%2Ftestkit-stub.git Fixing build error Code has been modified to be compatible with older c++ standards Change-Id: I5fa86c42282b1fb25a8e7aee5d35f491bb41cc72 Signed-off-by: Pawel Kaczmarczyk --- diff --git a/source/httpserver.cpp b/source/httpserver.cpp index 234f6af..4f27a64 100644 --- a/source/httpserver.cpp +++ b/source/httpserver.cpp @@ -567,12 +567,12 @@ void HttpServer::processpost(int s, struct HttpRequest *prequest) { } else if (prequest->path.find("/execute_command") != string::npos) { Json::Value paras = splitContent(prequest->content); std::string cmd = paras["cmd"].asString(); - std::vector output; - run_cmd(cmd, "", &output); + std::vector output_lines; + run_cmd(cmd, "", &output_lines); json_str = "{\"Input_value\" : \"" + cmd + "\"\n\"Output\" : ["; - for(auto line : output) { - json_str += "\"" + line + "\", "; + for (size_t i = 0; i < output_lines.size(); i++) { + json_str += "\"" + output_lines[i] + "\", "; } json_str = json_str.substr(0, json_str.size() - 2); json_str += "]}";