X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Fnumeric.c;h=380b9078b210deb9a6853cf2c966357efec75481;hb=7207bef418c655107d3076b20dd797418ad82cd7;hp=7d32ddc933fd5fd132e4efbf74defa1c961d3fd3;hpb=9a931a549b7e1b0979ce5f6088edf5136546f3ed;p=ngircd-alex.git diff --git a/src/ngircd/numeric.c b/src/ngircd/numeric.c index 7d32ddc9..380b9078 100644 --- a/src/ngircd/numeric.c +++ b/src/ngircd/numeric.c @@ -1,6 +1,6 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. + * Copyright (c)2001-2015 Alexander Barton (alex@barton.de) and Contributors. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -176,6 +176,7 @@ Synchronize_Lists(CLIENT * Client) CHANNEL *c; struct list_head *head; struct list_elem *elem; + time_t t; assert(Client != NULL); @@ -183,9 +184,10 @@ Synchronize_Lists(CLIENT * Client) head = Class_GetList(CLASS_GLINE); elem = Lists_GetFirst(head); while (elem) { + t = Lists_GetValidity(elem) - time(NULL); if (!IRC_WriteStrClient(Client, "GLINE %s %ld :%s", Lists_GetMask(elem), - Lists_GetValidity(elem) - time(NULL), + t > 0 ? (long)t : 0, Lists_GetReason(elem))) return DISCONNECTED; elem = Lists_GetNext(elem);