diff options
author | Nihal Jere <nihal@nihaljere.xyz> | 2022-03-20 13:00:11 -0500 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-05-07 15:57:18 +0200 |
commit | c85d9af2b6ee0478ffc21f3970280c5be6d9b925 (patch) | |
tree | ede131f68a3ec70260da5d1cd4a601c4eb49b171 | |
parent | e8028be8390c3daeadf5775d2e1c21c644ff4ee4 (diff) |
swaynag: combine consecutive declaration/assignments
-rw-r--r-- | swaynag/config.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/swaynag/config.c b/swaynag/config.c index ac5f31c0..9aeec3c2 100644 --- a/swaynag/config.c +++ b/swaynag/config.c @@ -166,8 +166,7 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag, fprintf(stderr, "Missing action for button %s\n", optarg); return EXIT_FAILURE; } - struct swaynag_button *button; - button = calloc(sizeof(struct swaynag_button), 1); + struct swaynag_button *button = calloc(sizeof(struct swaynag_button), 1); if (!button) { perror("calloc"); return EXIT_FAILURE; @@ -262,8 +261,7 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag, break; case 's': // Dismiss Button Text if (swaynag) { - struct swaynag_button *button_close; - button_close = swaynag->buttons->items[0]; + struct swaynag_button *button_close = swaynag->buttons->items[0]; free(button_close->text); button_close->text = strdup(optarg); } |