mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-31 07:11:09 -04:00
osc: kitty notifications: use xstrjoin() instead of xasprintf()
This commit is contained in:
parent
e88ec86c93
commit
e52d6e3fb8
1 changed files with 6 additions and 8 deletions
14
osc.c
14
osc.c
|
|
@ -722,8 +722,6 @@ kitty_notification(struct terminal *term, char *string)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notif == NULL) {
|
if (notif == NULL) {
|
||||||
/* Somewhat unoptimized... this will be free:d and removed
|
|
||||||
immediately if d=1 */
|
|
||||||
tll_push_front(term->notifications, ((struct notification){
|
tll_push_front(term->notifications, ((struct notification){
|
||||||
.id = id,
|
.id = id,
|
||||||
.icon = NULL,
|
.icon = NULL,
|
||||||
|
|
@ -766,18 +764,18 @@ kitty_notification(struct terminal *term, char *string)
|
||||||
notif->title = payload;
|
notif->title = payload;
|
||||||
payload = NULL;
|
payload = NULL;
|
||||||
} else {
|
} else {
|
||||||
char *new_title = xasprintf("%s%s", notif->title, payload);
|
char *old_title = notif->title;
|
||||||
free(notif->title);
|
notif->title = xstrjoin(old_title, payload);
|
||||||
notif->title = new_title;
|
free(old_title);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (notif->body == NULL) {
|
if (notif->body == NULL) {
|
||||||
notif->body = payload;
|
notif->body = payload;
|
||||||
payload = NULL;
|
payload = NULL;
|
||||||
} else {
|
} else {
|
||||||
char *new_body = xasprintf("%s%s", notif->body, payload);
|
char *old_body = notif->body;
|
||||||
free(notif->body);
|
notif->body = xstrjoin(old_body, payload);
|
||||||
notif->body = new_body;
|
free(old_body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue