Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2992 from orestisf1993/next
Browse files Browse the repository at this point in the history
i3bar: fix segfault when no status_command is provided
  • Loading branch information
Airblader committed Sep 27, 2017
2 parents 9aa016c + 4257107 commit a05773e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions i3bar/src/ipc.c
Expand Up @@ -177,7 +177,7 @@ void got_bar_config_update(char *event) {

/* update the configuration with the received settings */
DLOG("Received bar config update \"%s\"\n", event);
char *old_command = sstrdup(config.command);
char *old_command = config.command ? sstrdup(config.command) : NULL;
bar_display_mode_t old_mode = config.hide_on_modifier;
parse_config_json(event);
if (old_mode != config.hide_on_modifier) {
Expand All @@ -189,7 +189,7 @@ void got_bar_config_update(char *event) {
init_colors(&(config.colors));

/* restart status command process */
if (strcmp(old_command, config.command) != 0) {
if (old_command && strcmp(old_command, config.command) != 0) {
kill_child();
start_child(config.command);
}
Expand Down

0 comments on commit a05773e

Please sign in to comment.