aboutsummaryrefslogtreecommitdiff
path: root/procps/ps.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2019-05-03 09:49:56 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2019-05-03 09:49:56 +0200
commit3106784e654e7443ab724d927f9de0230adbe5ac (patch)
treef31a1832aa4c2dc4fef8ce7ed4714a798cdc3e9a /procps/ps.c
parentb052dbea54e2226ea49b9f3bdec3f6bccf879030 (diff)
downloadbusybox-w32-3106784e654e7443ab724d927f9de0230adbe5ac.tar.gz
busybox-w32-3106784e654e7443ab724d927f9de0230adbe5ac.tar.bz2
busybox-w32-3106784e654e7443ab724d927f9de0230adbe5ac.zip
ps: ensure fields are separated by at least one space, closes 11826
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to '')
-rw-r--r--procps/ps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/procps/ps.c b/procps/ps.c
index 54e6c40fc..815c11578 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -533,7 +533,7 @@ static void format_process(const procps_status_t *ps)
533 len = out[i].width - len + 1; 533 len = out[i].width - len + 1;
534 if (++i == out_cnt) /* do not pad last field */ 534 if (++i == out_cnt) /* do not pad last field */
535 break; 535 break;
536 p += sprintf(p, "%*s", len, ""); 536 p += sprintf(p, "%*s", len, " "); /* " ", not "", to ensure separation of fields */
537 } 537 }
538 printf("%.*s\n", terminal_width, buffer); 538 printf("%.*s\n", terminal_width, buffer);
539} 539}