[git commit] ps: ensure fields are separated by at least one space, closes 11826

Denys Vlasenko vda.linux at googlemail.com
Fri May 3 07:49:56 UTC 2019


commit: https://git.busybox.net/busybox/commit/?id=3106784e654e7443ab724d927f9de0230adbe5ac
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 procps/ps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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)
 		len = out[i].width - len + 1;
 		if (++i == out_cnt) /* do not pad last field */
 			break;
-		p += sprintf(p, "%*s", len, "");
+		p += sprintf(p, "%*s", len, " "); /* " ", not "", to ensure separation of fields */
 	}
 	printf("%.*s\n", terminal_width, buffer);
 }


More information about the busybox-cvs mailing list