aboutsummaryrefslogtreecommitdiff
path: root/libbb/procps.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/procps.c')
-rw-r--r--libbb/procps.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libbb/procps.c b/libbb/procps.c
index 295048c46..b4557e797 100644
--- a/libbb/procps.c
+++ b/libbb/procps.c
@@ -583,6 +583,8 @@ void FAST_FUNC read_cmdline(char *buf, int col, unsigned pid, const char *comm)
583 buf[sz] = '\0'; 583 buf[sz] = '\0';
584 while (--sz >= 0 && buf[sz] == '\0') 584 while (--sz >= 0 && buf[sz] == '\0')
585 continue; 585 continue;
586 /* Prevent basename("process foo/bar") = "bar" */
587 strchrnul(buf, ' ')[0] = '\0';
586 base = bb_basename(buf); /* before we replace argv0's NUL with space */ 588 base = bb_basename(buf); /* before we replace argv0's NUL with space */
587 while (sz >= 0) { 589 while (sz >= 0) {
588 if ((unsigned char)(buf[sz]) < ' ') 590 if ((unsigned char)(buf[sz]) < ' ')