* Get optional "reason" text stored in list element.
*
* @param list_elem List element.
- * @return Pointer to "reason" text or NULL.
+ * @return Pointer to "reason" text or empty string ("").
*/
GLOBAL const char *
Lists_GetReason(const struct list_elem *e)
{
assert(e != NULL);
- return e->reason;
+ return e->reason ? e->reason : "";
}
/**
assert(h != NULL);
assert(Mask != NULL);
- if (Lists_CheckDupeMask(h, Mask))
+ e = Lists_CheckDupeMask(h, Mask);
+ if (e) {
+ e->valid_until = ValidUntil;
+ if (Reason) {
+ free(e->reason);
+ e->reason = strdup(Reason);
+ }
return true;
+ }
e = Lists_GetFirst(h);
Lists_Check( struct list_head *h, CLIENT *Client)
{
struct list_elem *e, *last, *next;
- time_t now;
assert(h != NULL);
e = h->first;
last = NULL;
- now = time(NULL);
while (e) {
next = e->next;