Skip to content

config.c: cope with missing panel_items in tint2rc

lirnril requested to merge lirnril/tint2:master into master

When panel_items isn't set in tint2rc, tint2 segfaults during startup trying to iterate over the global panel_items_order, as it's left uninitialized to NULL after processing the config file.

config.c attempts to handle this case by using STR_APPEND_CH/STR_PREPEND_CH to append to or initialize panel_items_order when it isn't set explicitly. Alas, these macros make a local copy of the global variable, and don't assign the newly (re)allocated string back to the real panel_items_order.

I assume this is a macro hygiene thing, but it only makes these macros not work at all, so let's just skip the local copy.

Merge request reports

Loading