aboutsummaryrefslogtreecommitdiffstats
path: root/swaynag/swaynag.c
diff options
context:
space:
mode:
authorLibravatar Nihal Jere <nihal@nihaljere.xyz>2022-03-01 12:42:55 -0600
committerLibravatar Simon Ser <contact@emersion.fr>2022-03-15 11:40:32 +0100
commit1e79088a7245028fc0845d684cb5e2763f4f2816 (patch)
tree3e5e1f078ffb67c88b0c5df00c341f228fb21622 /swaynag/swaynag.c
parentswaynag: remove redundant status variables in main (diff)
downloadsway-1e79088a7245028fc0845d684cb5e2763f4f2816.tar.gz
sway-1e79088a7245028fc0845d684cb5e2763f4f2816.tar.zst
sway-1e79088a7245028fc0845d684cb5e2763f4f2816.zip
remove unnecessary strlen call
Diffstat (limited to 'swaynag/swaynag.c')
-rw-r--r--swaynag/swaynag.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/swaynag/swaynag.c b/swaynag/swaynag.c
index 60ae3e8f..5620155d 100644
--- a/swaynag/swaynag.c
+++ b/swaynag/swaynag.c
@@ -63,7 +63,7 @@ static void swaynag_button_execute(struct swaynag *swaynag,
63 } else if (pid == 0) { 63 } else if (pid == 0) {
64 // Child of the child. Will be reparented to the init process 64 // Child of the child. Will be reparented to the init process
65 char *terminal = getenv("TERMINAL"); 65 char *terminal = getenv("TERMINAL");
66 if (button->terminal && terminal && strlen(terminal)) { 66 if (button->terminal && terminal && *terminal) {
67 sway_log(SWAY_DEBUG, "Found $TERMINAL: %s", terminal); 67 sway_log(SWAY_DEBUG, "Found $TERMINAL: %s", terminal);
68 if (!terminal_execute(terminal, button->action)) { 68 if (!terminal_execute(terminal, button->action)) {
69 swaynag_destroy(swaynag); 69 swaynag_destroy(swaynag);
@@ -143,7 +143,7 @@ static void update_cursor(struct swaynag_seat *seat) {
143 const char *cursor_theme = getenv("XCURSOR_THEME"); 143 const char *cursor_theme = getenv("XCURSOR_THEME");
144 unsigned cursor_size = 24; 144 unsigned cursor_size = 24;
145 const char *env_cursor_size = getenv("XCURSOR_SIZE"); 145 const char *env_cursor_size = getenv("XCURSOR_SIZE");
146 if (env_cursor_size && strlen(env_cursor_size) > 0) { 146 if (env_cursor_size && *env_cursor_size) {
147 errno = 0; 147 errno = 0;
148 char *end; 148 char *end;
149 unsigned size = strtoul(env_cursor_size, &end, 10); 149 unsigned size = strtoul(env_cursor_size, &end, 10);