dont NUL terminate _NET_WM_NAME db223600
Reported by Kernc, thanks!

"This makes a particular program that uses libwnck [1] fail after:

    Wnck-WARNING **: Property _NET_WM_NAME contained invalid UTF-8

in this code [2] because the returned string contains a '\0' and the
documentation for g_utf8_validate() [3] explicitly states that when
string length is provided, no nul bytes are allowed."

It is not entirely clear it is incorrect, other WM's seem to not
NUL terminate it either though.
Hiltjo Posthuma · 2017-12-27 13:36 1 file(s) · +1 −1
dwm.c +1 −1
1579 1579
	XChangeProperty(dpy, wmcheckwin, netatom[NetWMCheck], XA_WINDOW, 32,
1580 1580
		PropModeReplace, (unsigned char *) &wmcheckwin, 1);
1581 1581
	XChangeProperty(dpy, wmcheckwin, netatom[NetWMName], utf8string, 8,
1582 -
		PropModeReplace, (unsigned char *) "dwm", 4);
1582 +
		PropModeReplace, (unsigned char *) "dwm", 3);
1583 1583
	XChangeProperty(dpy, root, netatom[NetWMCheck], XA_WINDOW, 32,
1584 1584
		PropModeReplace, (unsigned char *) &wmcheckwin, 1);
1585 1585
	/* EWMH support per view */