aboutsummaryrefslogtreecommitdiff
path: root/contrib/top
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2011-06-20 16:48:00 +0000
committerXin LI <delphij@FreeBSD.org>2011-06-20 16:48:00 +0000
commit7afed3bf7824268e93f0d1ea73b71beadc650343 (patch)
tree75c7aa9aaa1d8cca796932f76d41ad7c06ac42b4 /contrib/top
parentd82aac763c284bb60a47286057aeffb27a7f2d25 (diff)
downloadsrc-7afed3bf7824268e93f0d1ea73b71beadc650343.tar.gz
src-7afed3bf7824268e93f0d1ea73b71beadc650343.zip
Revert r214857 pursudant to 9.0-RELEASE cycle.
Requested by: jh
Notes
Notes: svn path=/head/; revision=223342
Diffstat (limited to 'contrib/top')
-rw-r--r--contrib/top/display.c12
-rw-r--r--contrib/top/top.h2
2 files changed, 3 insertions, 11 deletions
diff --git a/contrib/top/display.c b/contrib/top/display.c
index f0f0c2344bfc..8d89d825a33b 100644
--- a/contrib/top/display.c
+++ b/contrib/top/display.c
@@ -698,7 +698,7 @@ char *text;
int width;
s = NULL;
- width = screen_width;
+ width = display_width;
header_length = strlen(text);
if (header_length >= width) {
s = malloc((width + 1) * sizeof(char));
@@ -706,14 +706,6 @@ char *text;
return (NULL);
strncpy(s, text, width);
s[width] = '\0';
- } else {
- s = malloc((width + 1) * sizeof(char));
- if (s == NULL)
- return (NULL);
- strncpy(s, text, width);
- while (screen_width > header_length)
- s[header_length++] = ' ';
- s[width] = '\0';
}
return (s);
}
@@ -738,7 +730,7 @@ char *text;
if (header_status == ON)
{
putchar('\n');
- standout(text, stdout);
+ fputs(text, stdout);
lastline++;
}
else if (header_status == ERASE)
diff --git a/contrib/top/top.h b/contrib/top/top.h
index c51485a558d5..a281957c34bd 100644
--- a/contrib/top/top.h
+++ b/contrib/top/top.h
@@ -14,7 +14,7 @@
extern int Header_lines; /* 7 */
/* Maximum number of columns allowed for display */
-#define MAX_COLS 512
+#define MAX_COLS 128
/* Log base 2 of 1024 is 10 (2^10 == 1024) */
#define LOG1024 10