If it was just to add a '\0' then why not just add this line instead:
` wm_name_window[xcb_get_property_value_length(reply)] = '\0';`