termux-packages/x11-packages/st/x.c-xsettitle-check-return-...

19 lines
419 B
Diff
Raw Normal View History

--- a/x.c
+++ b/x.c
@@ -1585,11 +1585,14 @@
void
xsettitle(char *p)
{
+ int r;
XTextProperty prop;
DEFAULT(p, opt_title);
- Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
+ r = Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
&prop);
+ if (r != Success)
+ return;
XSetWMName(xw.dpy, xw.win, &prop);
XSetTextProperty(xw.dpy, xw.win, &prop, xw.netwmname);
XFree(prop.value);