top, ps: do not output trailing spaces

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2009-09-11 23:29:45 +02:00
parent 0052882200
commit ae357bd713
2 changed files with 3 additions and 1 deletions

View File

@ -1338,7 +1338,7 @@
#define ftpd_trivial_usage \ #define ftpd_trivial_usage \
"[-wvS] [-t N] [-T N] [DIR]" "[-wvS] [-t N] [-T N] [DIR]"
#define ftpd_full_usage "\n\n" \ #define ftpd_full_usage "\n\n" \
"FTP server\n" \ "Anonymous FTP server\n" \
"\n" \ "\n" \
"ftpd should be used as an inetd service.\n" \ "ftpd should be used as an inetd service.\n" \
"ftpd's line for inetd.conf:\n" \ "ftpd's line for inetd.conf:\n" \

View File

@ -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); sz = open_read_close(filename, buf, col);
if (sz > 0) { if (sz > 0) {
buf[sz] = '\0'; buf[sz] = '\0';
while (--sz >= 0 && buf[sz] == '\0')
continue;
while (--sz >= 0) while (--sz >= 0)
if ((unsigned char)(buf[sz]) < ' ') if ((unsigned char)(buf[sz]) < ' ')
buf[sz] = ' '; buf[sz] = ' ';