From bdf87326d28ef18158adf66aafdb6af1390389f0 Mon Sep 17 00:00:00 2001 From: albert <> Date: Sun, 13 Oct 2002 04:27:37 +0000 Subject: [PATCH] warning on Alpha --- top.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/top.c b/top.c index 1a71dc1e..b98171f8 100644 --- a/top.c +++ b/top.c @@ -1001,14 +1001,6 @@ static void configs_read (void) hunky-dory with nothing in an rcfile except the 1st 2 lines */ fscanf(fp, "%s\tfieldscur=%s\n" , Winstk[i]->winname, Winstk[i]->fieldscur); - /* - Our winname buffer is 4 bytes big - 3 chars + '\0'. - Q. let's say someone manually edits the rcfile and increases - a winname name to oh, 500 bytes - what's the net result? - A. fscanf wipes out 496 bytes of adjacent stg (fieldscur, etc), - then we catch it with strlen and end via std_err - no worries! - we might not have been so lucky if our WIN_t was laid out - differently and statically allocated or stack based!! */ if (WINNAMSIZ <= strlen(Winstk[i]->winname) || strlen(DEF_FIELDS) != strlen(Winstk[i]->fieldscur)) std_err(fmtmk(err_rc, RCfile)); @@ -1251,7 +1243,8 @@ static void display_fields (const char *fields, const char *xtra) ++i; printf("%s%.*s" , tg2((i / rmax) * cmax, (i % rmax) + yRSVD) - , p - xtra, xtra); + , (int)(p - xtra) + , xtra); xtra = ++p; } }