Skip to content

Commit 4aa6d3e

Browse files
committed
xfree86: loader: fix NULL warning on LogMessage() call
> ../hw/xfree86/loader/loadmod.c: In function ‘LoaderSetPath’: > ../hw/xfree86/loader/loadmod.c:230:67: warning: ‘%s’ directive argument is null [-Wformat-overflow=] > 230 | LogMessage(X_ERROR, "Failed to store module search path \"%s\" for module %s\n", path, driver); > | ^~ Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]>
1 parent 0aea4cf commit 4aa6d3e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hw/xfree86/loader/loadmod.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ LoaderSetPath(const char *driver, const char *path)
227227
if (item && item->name && (!path || item->paths))
228228
xorg_list_add(&item->entry, &modulePathLists);
229229
else {
230-
LogMessage(X_ERROR, "Failed to store module search path \"%s\" for module %s\n", path, driver);
230+
LogMessage(X_ERROR, "Failed to store module search path \"%s\" for module %s\n",
231+
path ? path : "<NULL>", driver);
231232
if (item) {
232233
if (item->name) free(item->name);
233234
if (item->paths) FreeStringList(item->paths);

0 commit comments

Comments
 (0)