Fixing build error 60/189360/2 tizen
authorPawel Kaczmarczyk <p.kaczmarczy@samsung.com>
Mon, 17 Sep 2018 07:46:37 +0000 (09:46 +0200)
committerPawel Kaczmarczyk <p.kaczmarczy@samsung.com>
Mon, 17 Sep 2018 08:21:39 +0000 (10:21 +0200)
Code has been modified to be
compatible with older c++ standards

Change-Id: I5fa86c42282b1fb25a8e7aee5d35f491bb41cc72
Signed-off-by: Pawel Kaczmarczyk <p.kaczmarczy@samsung.com>
source/httpserver.cpp

index 234f6af28914fc9a59c28f9b50bfab9d0724fb67..4f27a64a42caab01f40b2db198e8cef739ff1c7d 100644 (file)
@@ -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<std::string> output;
-                       run_cmd(cmd, "", &output);
+                       std::vector<std::string> 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 += "]}";