diff options
author | Denys Vlasenko | 2009-09-11 23:29:45 +0200 |
---|---|---|
committer | Denys Vlasenko | 2009-09-11 23:29:45 +0200 |
commit | ae357bd7138a179a1433b7d6e1aca48cc6438966 (patch) | |
tree | 3fec254b84c9b0b73108f69e270fa7315f8487dc /libbb | |
parent | 00528822004e5763c669e58191f10c5202f679b5 (diff) | |
download | busybox-ae357bd7138a179a1433b7d6e1aca48cc6438966.zip busybox-ae357bd7138a179a1433b7d6e1aca48cc6438966.tar.gz |
top, ps: do not output trailing spaces
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/procps.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libbb/procps.c b/libbb/procps.c index 307d8d6..9a8e42d 100644 --- a/libbb/procps.c +++ b/libbb/procps.c @@ -471,6 +471,8 @@ void FAST_FUNC read_cmdline(char *buf, int col, unsigned pid, const char *comm) sz = open_read_close(filename, buf, col); if (sz > 0) { buf[sz] = '\0'; + while (--sz >= 0 && buf[sz] == '\0') + continue; while (--sz >= 0) if ((unsigned char)(buf[sz]) < ' ') buf[sz] = ' '; |