summaryrefslogtreecommitdiffstats
path: root/contrib/top
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2011-06-20 16:48:00 +0000
committerdelphij <delphij@FreeBSD.org>2011-06-20 16:48:00 +0000
commitf715e0405adbd428c4c1f522fbff184fd36a83eb (patch)
tree75c7aa9aaa1d8cca796932f76d41ad7c06ac42b4 /contrib/top
parent923b3b3fa29752350d77364fcfaa29b6b241c0aa (diff)
downloadFreeBSD-src-f715e0405adbd428c4c1f522fbff184fd36a83eb.zip
FreeBSD-src-f715e0405adbd428c4c1f522fbff184fd36a83eb.tar.gz
Revert r214857 pursudant to 9.0-RELEASE cycle.
Requested by: jh
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 f0f0c23..8d89d82 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 c51485a..a281957 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
OpenPOWER on IntegriCloud