/*
* 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
PACKAGE_VERSION, Client_ID(target),
Client_ID(Client_NextHop(target)),
Option_String(idx2),
- time(NULL) - Conn_StartTime(idx2),
+ (long)(time(NULL) - Conn_StartTime(idx2)),
Conn_SendQ(idx), Conn_SendQ(idx2)))
return DISCONNECTED;
IRC_KillClient(CLIENT *Client, CLIENT *From, const char *Nick, const char *Reason)
{
const char *msg;
- CONN_ID my_conn, conn;
+ CONN_ID my_conn = NONE, conn;
CLIENT *c;
+ assert(Nick != NULL);
+ assert(Reason != NULL);
+
/* Do we know such a client in the network? */
c = Client_Search(Nick);
if (!c) {
}
/* Save ID of this connection */
- my_conn = Client_Conn(Client);
+ if (Client)
+ my_conn = Client_Conn(Client);
/* Kill the client NOW:
* - Close the local connection (if there is one),
Client_ID(Client), Req->command);
}
- if (Client_Type(Client) == CLIENT_SERVER)
+ if (Client_Type(Client) == CLIENT_SERVER && Req->prefix)
from = Client_Search(Req->prefix);
else
from = Client;
* dot (".") and no wildcards ("*", "?") following the last one.
*/
check_wildcards = strrchr(targetMask, '.');
- assert(check_wildcards != NULL);
- if (check_wildcards &&
- check_wildcards[strcspn(check_wildcards, "*?")])
- {
+ if (!check_wildcards || check_wildcards[strcspn(check_wildcards, "*?")]) {
if (!SendErrors)
return true;
return IRC_WriteErrClient(from, ERR_WILDTOPLEVEL, targetMask);