glx: Fix error message when no driverName is available
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Tue, 4 Jun 2019 22:23:41 +0000 (15:23 -0700)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Tue, 4 Jun 2019 22:28:12 +0000 (15:28 -0700)
commit04e8ff85959278748b76877ad23d838c87d01919
tree2b01d258c346491228d20a4b5926bca77ffcb817
parent65439291a02066f0e18090f8ce9645a8a1ba97a4
glx: Fix error message when no driverName is available

Just provide a "(null)" literal in case driverName is NULL.

  In file included from ../src/glx/dri3_glx.c:76:
  ../src/glx/dri3_glx.c: In function ‘dri3_create_screen’:
  ../src/glx/dri_common.h:70:36: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
     70 | #define CriticalErrorMessageF(...) dri_message(_LOADER_FATAL, __VA_ARGS__)
        |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../src/glx/dri3_glx.c:1002:4: note: in expansion of macro ‘CriticalErrorMessageF’
   1002 |    CriticalErrorMessageF("failed to load driver: %s\n", driverName);
        |    ^~~~~~~~~~~~~~~~~~~~~
  ../src/glx/dri3_glx.c:1002:50: note: format string is defined here
   1002 |    CriticalErrorMessageF("failed to load driver: %s\n", driverName);
        |                                                  ^~
  cc1: some warnings being treated as errors

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glx/dri3_glx.c