Remove trailing bytes from the cmd string read from /proc/PID/cmdline 50/137950/1
authorMu-Woong Lee <muwoong.lee@samsung.com>
Mon, 10 Jul 2017 11:12:42 +0000 (20:12 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Mon, 10 Jul 2017 11:12:42 +0000 (20:12 +0900)
Change-Id: Ic9ddbec882746395311309c5574104bb2b51d8a6
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
src/server/ServiceClient.cpp

index fe8ced2..3cc8e8a 100644 (file)
@@ -66,7 +66,8 @@ const std::string& ServiceClient::getName()
        std::string cmdline;
 
        if (std::getline(cmdfile, cmdline)) {
-               __name = cmdline;
+               g_snprintf(buffer, BUFFER_SIZE, "%s", cmdline.c_str());
+               __name = buffer;
                _I("cmd: %s", __name.c_str());
                return __name;
        }