diff --git a/src/notification.c b/src/notification.c index 8c046c1..ad6beea 100644 --- a/src/notification.c +++ b/src/notification.c @@ -438,7 +438,10 @@ void notification_init(notification *n) n->dup_count = 0; /* urgency > URG_CRIT -> array out of range */ - n->urgency = n->urgency > URG_CRIT ? URG_CRIT : n->urgency; + if (n->urgency < URG_MIN) + n->urgency = URG_LOW; + if (n->urgency > URG_MAX) + n->urgency = URG_CRIT; if (!n->color_strings[ColFG]) { n->color_strings[ColFG] = xctx.color_strings[ColFG][n->urgency]; diff --git a/src/notification.h b/src/notification.h index df574ac..29b6c6c 100644 --- a/src/notification.h +++ b/src/notification.h @@ -11,9 +11,11 @@ enum urgency { URG_NONE = -1, + URG_MIN = 0, URG_LOW = 0, URG_NORM = 1, URG_CRIT = 2, + URG_MAX = 2, }; typedef struct _raw_image {