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 1080e0165..c6977da51 100644
--- a/libbb/procps.c
+++ b/libbb/procps.c
@@ -586,6 +586,8 @@ void FAST_FUNC read_cmdline(char *buf, int col, unsigned pid, const char *comm)
586 buf[sz] = '\0'; 586 buf[sz] = '\0';
587 while (--sz >= 0 && buf[sz] == '\0') 587 while (--sz >= 0 && buf[sz] == '\0')
588 continue; 588 continue;
589 /* Prevent basename("process foo/bar") = "bar" */
590 strchrnul(buf, ' ')[0] = '\0';
589 base = bb_basename(buf); /* before we replace argv0's NUL with space */ 591 base = bb_basename(buf); /* before we replace argv0's NUL with space */
590 while (sz >= 0) { 592 while (sz >= 0) {
591 if ((unsigned char)(buf[sz]) < ' ') 593 if ((unsigned char)(buf[sz]) < ' ')