aboutsummaryrefslogtreecommitdiffstats
path: root/swaynag/main.c
diff options
context:
space:
mode:
authorLibravatar Nihal Jere <nihal@nihaljere.xyz>2022-02-25 11:40:04 -0600
committerLibravatar Simon Zeni <simon@bl4ckb0ne.ca>2022-02-28 11:24:13 -0500
commit061ffc30ea899c3ed77004065d3958f19e3bb884 (patch)
tree5e1874ef52852964732b2552671d0171623b1543 /swaynag/main.c
parentDon't enter seatop_move_floating when fullscreen (diff)
downloadsway-061ffc30ea899c3ed77004065d3958f19e3bb884.tar.gz
sway-061ffc30ea899c3ed77004065d3958f19e3bb884.tar.zst
sway-061ffc30ea899c3ed77004065d3958f19e3bb884.zip
swaynag: die on all allocation failures
Diffstat (limited to 'swaynag/main.c')
-rw-r--r--swaynag/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/swaynag/main.c b/swaynag/main.c
index 88007818..0c94cb1a 100644
--- a/swaynag/main.c
+++ b/swaynag/main.c
@@ -32,12 +32,20 @@ int main(int argc, char **argv) {
32 32
33 struct swaynag_button *button_close = 33 struct swaynag_button *button_close =
34 calloc(sizeof(struct swaynag_button), 1); 34 calloc(sizeof(struct swaynag_button), 1);
35 if (!button_close) {
36 perror("calloc");
37 return EXIT_FAILURE;
38 }
35 button_close->text = strdup("X"); 39 button_close->text = strdup("X");
36 button_close->type = SWAYNAG_ACTION_DISMISS; 40 button_close->type = SWAYNAG_ACTION_DISMISS;
37 list_add(swaynag.buttons, button_close); 41 list_add(swaynag.buttons, button_close);
38 42
39 swaynag.details.button_details = 43 swaynag.details.button_details =
40 calloc(sizeof(struct swaynag_button), 1); 44 calloc(sizeof(struct swaynag_button), 1);
45 if (!swaynag.details.button_details) {
46 perror("calloc");
47 return EXIT_FAILURE;
48 }
41 swaynag.details.button_details->text = strdup("Toggle details"); 49 swaynag.details.button_details->text = strdup("Toggle details");
42 swaynag.details.button_details->type = SWAYNAG_ACTION_EXPAND; 50 swaynag.details.button_details->type = SWAYNAG_ACTION_EXPAND;
43 51