Remove trailing bytes from the cmd string read from /proc/PID/cmdline