mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
xkb: Silence a warning from gcc 11
I get this:
In function ‘TryCopyStr’,
inlined from ‘CopyISOLockArgs’ at ../xkb/xkbtext.c:875:9:
../xkb/xkbtext.c:720:13: warning: ‘tbuf’ may be used uninitialized [-Wmaybe-uninitialized]
720 | strcat(to, from);
| ^~~~~~~~~~~~~~~~
../xkb/xkbtext.c: In function ‘CopyISOLockArgs’:
<built-in>: note: by argument 1 of type ‘const char *’ to ‘__builtin_strlen’ declared here
../xkb/xkbtext.c:871:10: note: ‘tbuf’ declared here
871 | char tbuf[64];
| ^~~~
Just initialize tbuf so it definitely works.
This commit is contained in:
@@ -870,6 +870,7 @@ CopyISOLockArgs(XkbDescPtr xkb, XkbAction *action, char *buf, int *sz)
|
||||
XkbISOAction *act;
|
||||
char tbuf[64];
|
||||
|
||||
memset(tbuf, 0, sizeof(tbuf));
|
||||
act = &action->iso;
|
||||
if (act->flags & XkbSA_ISODfltIsGroup) {
|
||||
TryCopyStr(tbuf, "group=", sz);
|
||||
|
||||
Reference in New Issue
Block a user