bspwm
bspwm copied to clipboard
Fix segfault caused by non-null-terminated string.
I got the printf %.*s idea from xcb documentation somewhere but now I can't find it.
Fixes #1503
Hopefully this is the only case. I searched for xcb_ in the source and gave the results a cursory look.
This looks correct. For reference to the printf field width specifier, I found it in xcb_get_property_reply.3. If my memory serves me right, the xcb_icccm stuff are mainly wrappers around the xcb property and atom interface. The manual page mentions using the xcb_get_property_value* accessors, but this is actually done by xcb_icccm_get_wm_name.