mirror of
https://github.com/swaywm/sway.git
synced 2024-11-22 16:01:27 +00:00
swaynag: combine consecutive declaration/assignments
This commit is contained in:
parent
e8028be839
commit
c85d9af2b6
|
@ -166,8 +166,7 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag,
|
||||||
fprintf(stderr, "Missing action for button %s\n", optarg);
|
fprintf(stderr, "Missing action for button %s\n", optarg);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
struct swaynag_button *button;
|
struct swaynag_button *button = calloc(sizeof(struct swaynag_button), 1);
|
||||||
button = calloc(sizeof(struct swaynag_button), 1);
|
|
||||||
if (!button) {
|
if (!button) {
|
||||||
perror("calloc");
|
perror("calloc");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
@ -262,8 +261,7 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag,
|
||||||
break;
|
break;
|
||||||
case 's': // Dismiss Button Text
|
case 's': // Dismiss Button Text
|
||||||
if (swaynag) {
|
if (swaynag) {
|
||||||
struct swaynag_button *button_close;
|
struct swaynag_button *button_close = swaynag->buttons->items[0];
|
||||||
button_close = swaynag->buttons->items[0];
|
|
||||||
free(button_close->text);
|
free(button_close->text);
|
||||||
button_close->text = strdup(optarg);
|
button_close->text = strdup(optarg);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue