diff --git a/top/top.c b/top/top.c index e64c8660..52b0a050 100644 --- a/top/top.c +++ b/top/top.c @@ -4467,9 +4467,12 @@ static void whack_terminal (void) { static void win_names (WIN_t *q, const char *name) { /* note: sprintf/snprintf results are "undefined" when src==dst, according to C99 & POSIX.1-2001 (thanks adc) */ +#pragma GCC diagnostic push +#pragma GCC diagnostic warning "-Wformat-truncation" if (q->rc.winname != name) snprintf(q->rc.winname, sizeof(q->rc.winname), "%s", name); snprintf(q->grpname, sizeof(q->grpname), "%d:%s", q->winnum, name); +#pragma GCC diagnostic pop } // end: win_names