aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'swaybar/input.c')
-rw-r--r--swaybar/input.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/swaybar/input.c b/swaybar/input.c
index 8a83f38f..8b83eab4 100644
--- a/swaybar/input.c
+++ b/swaybar/input.c
@@ -70,10 +70,11 @@ void update_cursor(struct swaybar_seat *seat) {
70 const char *cursor_theme = getenv("XCURSOR_THEME"); 70 const char *cursor_theme = getenv("XCURSOR_THEME");
71 unsigned cursor_size = 24; 71 unsigned cursor_size = 24;
72 const char *env_cursor_size = getenv("XCURSOR_SIZE"); 72 const char *env_cursor_size = getenv("XCURSOR_SIZE");
73 if (env_cursor_size) { 73 if (env_cursor_size && strlen(env_cursor_size) > 0) {
74 errno = 0;
74 char *end; 75 char *end;
75 unsigned size = strtoul(env_cursor_size, &end, 10); 76 unsigned size = strtoul(env_cursor_size, &end, 10);
76 if (!*end) { 77 if (!*end && errno == 0) {
77 cursor_size = size; 78 cursor_size = size;
78 } 79 }
79 } 80 }