mirror of
https://github.com/systemd/systemd.git
synced 2025-03-01 08:58:29 +03:00
process-util: make use of delete_trailing_chars() in get_process_cmdline()
This commit is contained in:
parent
1627069766
commit
af8974940d
@ -258,15 +258,10 @@ int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char *
|
||||
memcpy(ans, "[...]", max_length-1);
|
||||
ans[max_length-1] = 0;
|
||||
} else {
|
||||
char *e;
|
||||
|
||||
t[max_length - 6] = 0;
|
||||
|
||||
/* Chop off final spaces */
|
||||
e = strchr(t, 0);
|
||||
while (e > t && isspace(e[-1]))
|
||||
e--;
|
||||
*e = 0;
|
||||
delete_trailing_chars(t, WHITESPACE);
|
||||
|
||||
ans = strjoin("[", t, "...]");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user