Fix process name updates for shorter strings (#812)

When a process name changes from a long string to a short string,
truncate instead of just overwriting the beginning.
This commit is contained in:
Score_Under 2018-07-28 04:08:40 +01:00 committed by Hisham Muhammad
parent 666e1e76b3
commit d74b6dc8e0
1 changed files with 1 additions and 1 deletions

View File

@ -709,7 +709,7 @@ static bool LinuxProcessList_readCmdlineFile(Process* process, const char* dirna
}
command[lastChar + 1] = '\0';
process->basenameOffset = tokenEnd;
setCommand(process, command, lastChar);
setCommand(process, command, lastChar + 1);
return true;
}