aboutsummaryrefslogtreecommitdiff
path: root/wayland.c
diff options
context:
space:
mode:
authorCraig Barnes <craigbarnes@protonmail.com>2023-01-06 23:43:51 +0000
committerCraig Barnes <craigbarnes@protonmail.com>2023-01-06 23:43:51 +0000
commitf19768e30406ad154ebdb7f75ce8a656a130db4c (patch)
tree15a935e13d4942c7581f61734c1eedd8e908c718 /wayland.c
parentthemes: add Onedark (diff)
wayland: avoid passing NULL to log_msg() in wayl_reload_xcursor_theme()
This pointer ends up being passed to various printf-family functions, where passing a NULL pointer for an "%s" format specifier invokes undefined behaviour.
Diffstat (limited to 'wayland.c')
-rw-r--r--wayland.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/wayland.c b/wayland.c
index e48d59aa..55d45da7 100644
--- a/wayland.c
+++ b/wayland.c
@@ -1704,7 +1704,8 @@ wayl_reload_xcursor_theme(struct seat *seat, int new_scale)
const char *xcursor_theme = getenv("XCURSOR_THEME");
LOG_INFO("cursor theme: %s, size: %d, scale: %d",
- xcursor_theme, xcursor_size, new_scale);
+ xcursor_theme ? xcursor_theme : "(null)",
+ xcursor_size, new_scale);
seat->pointer.theme = wl_cursor_theme_load(
xcursor_theme, xcursor_size * new_scale, seat->wayl->shm);