libgnt/libgnt

Fix buffer size

2021-02-04, Richard Laager
f4557d5ed92d
Parents b1b6b80c9f91
Children 9d23268ff9c8
Fix buffer size

../gntwm.c:819:47: warning: ‘__builtin___snprintf_chk’ output may be
truncated before the last format character [-Wformat-truncation=]
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note:
‘__builtin___snprintf_chk’ output between 8 and 13 bytes into a
destination of size 12

Testing Done:
With this change, the compiler warning is eliminated.

Reviewed at https://reviews.imfreedom.org/r/475/
  • +1 -1
    gntwm.c
  • --- a/gntwm.c Fri Nov 20 16:24:25 2020 -0600
    +++ b/gntwm.c Thu Feb 04 21:07:16 2021 -0600
    @@ -824,7 +824,7 @@
    now ^= ch[0];
    #else
    cchar_t wch;
    - char unicode[12];
    + char unicode[13];
    memset(&wch, 0, sizeof(wch));
    mvwin_wch(curscr, y, x, &wch);
    now = wch.attr;