Sanitize negative urgency correctly
This commit is contained in:
parent
20807a09b0
commit
823665a3bd
@ -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];
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user