summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Warner <james.warner@comcast.net>2022-01-08 00:00:00 -0600
committerCraig Small <csmall@dropbear.xyz>2022-01-13 19:34:39 +1100
commit44ca06f1a05b31880ca0ec4e59923a3255f5816d (patch)
tree979d31fdd161c4cec504324ec9805581643209a6
parent4fdba9627a668d08597940ce0fded1563489066a (diff)
downloadprocps-ng-44ca06f1a05b31880ca0ec4e59923a3255f5816d.tar.gz
top: eliminate every warning for '-Wformat-truncation'
Signed-off-by: Jim Warner <james.warner@comcast.net>
-rw-r--r--top/top.c4
-rw-r--r--top/top.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/top/top.c b/top/top.c
index f068266..15f4cee 100644
--- a/top/top.c
+++ b/top/top.c
@@ -129,7 +129,7 @@ static char Cap_clr_eol [CAPBUFSIZ] = "", // global and/or static vars
Cap_norm [CAPBUFSIZ] = "",
Cap_reverse [CAPBUFSIZ] = "",
Caps_off [CAPBUFSIZ] = "",
- Caps_endline [CAPBUFSIZ] = "";
+ Caps_endline [SMLBUFSIZ] = "";
#ifndef RMAN_IGNORED
static char Cap_rmam [CAPBUFSIZ] = "",
Cap_smam [CAPBUFSIZ] = "";
@@ -913,7 +913,7 @@ static void show_special (int interact, const char *glob) {
( However, such an approach was abandoned. As a result )
( this function is called only with a glob under top's )
( control and never containing any 'raw/binary' chars! ) */
- char tmp[LRGBUFSIZ], lin[LRGBUFSIZ], row[ROWMAXSIZ];
+ char tmp[LRGBUFSIZ], lin[LRGBUFSIZ], row[ROWMINSIZ];
char *rp, *lin_end, *sub_beg, *sub_end;
int room;
diff --git a/top/top.h b/top/top.h
index af31681..20c4a7a 100644
--- a/top/top.h
+++ b/top/top.h
@@ -137,7 +137,7 @@ char *strcasestr(const char *haystack, const char *needle);
#define BIGBUFSIZ 2048
/* in addition to the actual display data, our row might have to accommodate
many termcap/color transitions - these definitions ensure we have room */
-#define ROWMINSIZ ( SCREENMAX + 4 * (CAPBUFSIZ + CLRBUFSIZ) )
+#define ROWMINSIZ ( SCREENMAX + 8 * (CAPBUFSIZ + CLRBUFSIZ) )
#define ROWMAXSIZ ( SCREENMAX + 16 * (CAPBUFSIZ + CLRBUFSIZ) )
// minimum size guarantee for dynamically acquired 'readfile' buffer
#define READMINSZ 2048