mirror of
https://github.com/i3/i3.git
synced 2025-10-29 11:25:59 +00:00
i3bar: fix clang compilation error by using const size_t (#6349)
Thanks to Shouη (@Shoun2137 on GitHub) for the suggestion.
This commit is contained in:
parent
9dc5230000
commit
853b0d9161
@ -1517,8 +1517,9 @@ static void init_tray(void) {
|
||||
/* request the tray manager atom for the X11 display we are running on */
|
||||
/* The following line cannot use strlen as that makes compilation fail with
|
||||
* some versions of clang (-Wgnu-folding-constant): */
|
||||
char atomname[18 /* strlen("_NET_SYSTEM_TRAY_S") */ + 11];
|
||||
snprintf(atomname, strlen("_NET_SYSTEM_TRAY_S") + 11, "_NET_SYSTEM_TRAY_S%d", screen);
|
||||
const size_t systray_len = strlen("_NET_SYSTEM_TRAY_S") + 11;
|
||||
char atomname[systray_len];
|
||||
snprintf(atomname, systray_len, "_NET_SYSTEM_TRAY_S%d", screen);
|
||||
xcb_intern_atom_cookie_t tray_cookie;
|
||||
if (tray_reply == NULL) {
|
||||
tray_cookie = xcb_intern_atom(xcb_connection, 0, strlen(atomname), atomname);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user