libgnt/libgnt

Fix buffer size
release-2.x.y
2021-02-04, Gary Kramlich
06521c6a66e1
Parents 65d90f92d626
Children ee7b6e65ace6
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 Thu Feb 04 21:05:56 2021 -0600
    +++ b/gntwm.c Thu Feb 04 21:14:57 2021 -0600
    @@ -746,7 +746,7 @@
    now ^= ch[0];
    #else
    cchar_t wch;
    - char unicode[12];
    + char unicode[13];
    mvwin_wch(curscr, y, x, &wch);
    now = wch.attr;
    ch[0] = (char)(wch.chars[0] & 0xff);