aboutsummaryrefslogtreecommitdiff
path: root/swaybar
diff options
context:
space:
mode:
Diffstat (limited to 'swaybar')
-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) {
const char *cursor_theme = getenv("XCURSOR_THEME");
unsigned cursor_size = 24;
const char *env_cursor_size = getenv("XCURSOR_SIZE");
- if (env_cursor_size) {
+ if (env_cursor_size && strlen(env_cursor_size) > 0) {
+ errno = 0;
char *end;
unsigned size = strtoul(env_cursor_size, &end, 10);
- if (!*end) {
+ if (!*end && errno == 0) {
cursor_size = size;
}
}