dix: SetFontPath: don't set errorValue on Success

Clears warning from gcc 14.1:

../dix/dixfonts.c: In function ‘SetFontPath’:
../dix/dixfonts.c:1697:28: warning: use of uninitialized value ‘bad’
 [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
 1697 |         client->errorValue = bad;
      |         ~~~~~~~~~~~~~~~~~~~^~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1673>
This commit is contained in:
Alan Coopersmith 2024-09-08 09:45:54 -07:00 committed by Enrico Weigelt, metux IT consult
parent 09302541a5
commit 80284fae7e

View File

@ -1692,7 +1692,8 @@ SetFontPath(ClientPtr client, int npaths, unsigned char *paths)
int bad; int bad;
err = SetFontPathElements(npaths, paths, &bad, FALSE); err = SetFontPathElements(npaths, paths, &bad, FALSE);
client->errorValue = bad; if (err != Success)
client->errorValue = bad;
} }
return err; return err;
} }