View | Details | Raw Unified | Return to bug 45927
Collapse All | Expand All

(-)a/top/top.c (-2 / +7 lines)
Lines 4462-4477 static void whack_terminal (void) { Link Here
4462
4462
4463
/*######  Windows/Field Groups support  #################################*/
4463
/*######  Windows/Field Groups support  #################################*/
4464
4464
4465
#define xstr(s) str(s)
4466
#define str(s) #s
4467
4465
        /*
4468
        /*
4466
         * Value a window's name and make the associated group name. */
4469
         * Value a window's name and make the associated group name. */
4467
static void win_names (WIN_t *q, const char *name) {
4470
static void win_names (WIN_t *q, const char *name) {
4468
   /* note: sprintf/snprintf results are "undefined" when src==dst,
4471
   /* note: sprintf/snprintf results are "undefined" when src==dst,
4469
            according to C99 & POSIX.1-2001 (thanks adc) */
4472
            according to C99 & POSIX.1-2001 (thanks adc) */
4470
   if (q->rc.winname != name)
4473
   if (q->rc.winname != name)
4471
      snprintf(q->rc.winname, sizeof(q->rc.winname), "%s", name);
4474
      snprintf(q->rc.winname, sizeof(q->rc.winname), "%." xstr(WINNAMSIZ) "s", name);
4472
   snprintf(q->grpname, sizeof(q->grpname), "%d:%s", q->winnum, name);
4475
   snprintf(q->grpname, sizeof(q->grpname), "%d:%." xstr(WINNAMSIZ) "s", q->winnum, name);
4473
} // end: win_names
4476
} // end: win_names
4474
4477
4478
#undef str
4479
#undef xstr
4475
4480
4476
        /*
4481
        /*
4477
         * This guy just resets (normalizes) a single window
4482
         * This guy just resets (normalizes) a single window
(-)a/top/top.h (-3 / +2 lines)
Lines 378-384 typedef struct RCW_t { // the 'window' portion of an rcfile Link Here
378
          msgsclr,                //             "           in msgs/pmts
378
          msgsclr,                //             "           in msgs/pmts
379
          headclr,                //             "           in cols head
379
          headclr,                //             "           in cols head
380
          taskclr;                //             "           in task rows
380
          taskclr;                //             "           in task rows
381
   char   winname [WINNAMSIZ],    // name for the window, user changeable
381
   char   winname [WINNAMSIZ+1],    // name for the window, user changeable
382
          fieldscur [PFLAGSSIZ];  // the fields for display & their order
382
          fieldscur [PFLAGSSIZ];  // the fields for display & their order
383
} RCW_t;
383
} RCW_t;
384
384
Lines 427-433 typedef struct WIN_t { Link Here
427
          capclr_rowhigh [CLRBUFSIZ],  //         are only used when this
427
          capclr_rowhigh [CLRBUFSIZ],  //         are only used when this
428
          capclr_rownorm [CLRBUFSIZ],  //         window is the 'Curwin'!
428
          capclr_rownorm [CLRBUFSIZ],  //         window is the 'Curwin'!
429
          cap_bold [CAPBUFSIZ],        // support for View_NOBOLD toggle
429
          cap_bold [CAPBUFSIZ],        // support for View_NOBOLD toggle
430
          grpname [GRPNAMSIZ],         // window number:name, printable
430
          grpname [GRPNAMSIZ+1],         // window number:name, printable
431
#ifdef USE_X_COLHDR
431
#ifdef USE_X_COLHDR
432
          columnhdr [ROWMINSIZ],       // column headings for procflgs
432
          columnhdr [ROWMINSIZ],       // column headings for procflgs
433
#else
433
#else
434
- 

Return to bug 45927