rem: sprintf(q->columnhdr, "%s", Mode_altscr ? fmtmk("%d", q->winnum) : "");
add: snprintf(q->columnhdr, sizeof(q->columnhdr), "%s" , Mode_altscr ? fmtmk("%d", q->winnum) : "");
context: static void win_colsheads (WIN_t *q){   const char *h;   int i, needpsdb = 0;      /* build window's procflags array and establish a tentative maxpflgs */   for (i = 0, q->maxpflgs = 0; q->fieldscur[i]; i++) {      if (isupper(q->fieldscur[i]))         q->procflags[q->maxpflgs++] = q->fieldscur[i] - 'A';   }      /* build a preliminary columns header not to exceed screen width         (and account for a possible leading window number) */   if (Mode_altscr) strcpy(q->columnhdr, " "); else q->columnhdr[0] = '\0';   for (i = 0; i < q->maxpflgs; i++) {      h = Fieldstab[q->procflags[i]].head;         /* oops, won't fit -- we're outta here... */      if (Screen_cols < (int)(strlen(q->columnhdr) + strlen(h))) break;      strcat(q->columnhdr, h);   }      /* establish the final maxpflgs and prepare to grow the command         column heading via maxcmdln -- it may be a fib if P_CMD wasn't         encountered, but that's ok because it won't be displayed anyway */   q->maxpflgs = i;   q->maxcmdln = Screen_cols      - (strlen(q->columnhdr) - strlen(Fieldstab[P_CMD].head)) - 1;      /* now we can build the true run-time columns header and format the         command column heading if P_CMD is really being displayed --         show_a_task is aware of the addition of winnum to the header */   sprintf(q->columnhdr, "%s", Mode_altscr ? fmtmk("%d", q->winnum) : "");   for (i = 0; i < q->maxpflgs; i++) {      h = Fieldstab[q->procflags[i]].head;         /* are we gonna' need the kernel symbol table? */      if (P_WCH == q->procflags[i]) needpsdb = 1;      if (P_CMD == q->procflags[i])         strcat(q->columnhdr            , fmtmk(Fieldstab[P_CMD].fmts, q->maxcmdln, q->maxcmdln, h));      else         strcat(q->columnhdr, h);   }      /* do we need the kernel symbol table (and is it already open?) */   if (needpsdb) {      if (-1 == No_ksyms) {         No_ksyms = 0;         if (open_psdb_message(NULL, msg_save))            /* why so counter-intuitive, couldn't open_psdb_message               mirror sysmap_mmap -- that func does all the work anyway? */            No_ksyms = 1;         else            PSDBopen = 1;      }   }}