diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-08 14:47:33 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-08 14:50:46 -0800 |
commit | c311687d90564f670e1ec943371c5cab4711f3e3 (patch) | |
tree | 5dcd637478c8db17e5ec6924e4c0c30eb2b6f511 | |
parent | a318124b38bbfac36f6bfe537839b0d3a9065b94 (diff) |
Ensure screenNum is always initialized
Clears this warning from clang, even though it seems like a
false positive, as all the uses are behind the same conditions:
xdriinfo.c:117:27: warning: variable 'screenNum' may be uninitialized
when used here [-Wconditional-uninitialized]
if (func == DRIVER && screenNum == -1) {
^~~~~~~~~
xdriinfo.c:61:28: note: initialize the variable 'screenNum' to silence
this warning
int nScreens, screenNum;
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xdriinfo.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -112,6 +112,8 @@ int main (int argc, char *argv[]) { return 1; } } + else + screenNum = -1; /* driver command needs a valid screen number */ if (func == DRIVER && screenNum == -1) { |