aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNihal Jere <nihal@nihaljere.xyz>2022-03-01 12:42:55 -0600
committerSimon Ser <contact@emersion.fr>2022-03-15 11:40:32 +0100
commit1e79088a7245028fc0845d684cb5e2763f4f2816 (patch)
tree3e5e1f078ffb67c88b0c5df00c341f228fb21622
parent78758ef3696d195b8622c34feb042b63cc03bd49 (diff)
remove unnecessary strlen call
-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,
} else if (pid == 0) {
// Child of the child. Will be reparented to the init process
char *terminal = getenv("TERMINAL");
- if (button->terminal && terminal && strlen(terminal)) {
+ if (button->terminal && terminal && *terminal) {
sway_log(SWAY_DEBUG, "Found $TERMINAL: %s", terminal);
if (!terminal_execute(terminal, button->action)) {
swaynag_destroy(swaynag);
@@ -143,7 +143,7 @@ static void update_cursor(struct swaynag_seat *seat) {
const char *cursor_theme = getenv("XCURSOR_THEME");
unsigned cursor_size = 24;
const char *env_cursor_size = getenv("XCURSOR_SIZE");
- if (env_cursor_size && strlen(env_cursor_size) > 0) {
+ if (env_cursor_size && *env_cursor_size) {
errno = 0;
char *end;
unsigned size = strtoul(env_cursor_size, &end, 10);