aboutsummaryrefslogtreecommitdiff
path: root/osc.c
diff options
context:
space:
mode:
authorJack Wilsdon <jack@wilsdon.me>2024-10-28 17:52:09 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-10-31 06:03:04 +0000
commit689549bb1f85f2ff7e1710d527dc2ead4cb3bb5b (patch)
tree11edc5569d0c4f89d9ced6369f11a8ff5f88a681 /osc.c
parentdocs: document more default bindings in search scrollback mode. (diff)
osc: notify: fix crash with no message
Closes #1866
Diffstat (limited to 'osc.c')
-rw-r--r--osc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/osc.c b/osc.c
index 5efc7588..535e29c8 100644
--- a/osc.c
+++ b/osc.c
@@ -557,9 +557,13 @@ osc_notify(struct terminal *term, char *string)
return;
}
+ char *msgdup = NULL;
+ if (msg != NULL)
+ msgdup = xstrdup(msg);
+
notify_notify(term, &(struct notification){
.title = xstrdup(title),
- .body = xstrdup(msg),
+ .body = msgdup,
.expire_time = -1,
.focus = true,
});