From: Pekka Riikonen Date: Mon, 16 Dec 2002 18:43:33 +0000 (+0000) Subject: Do not print the nickname on SERVER_SIGNOFF if we do not have it. X-Git-Tag: silc.client.0.9.11~22 X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=a2b984d4f1968d8ee3d4987433f4d20eb20b0ee8;p=silc.git Do not print the nickname on SERVER_SIGNOFF if we do not have it. Fixes asserts in Irssi Core. --- diff --git a/apps/irssi/src/silc/core/client_ops.c b/apps/irssi/src/silc/core/client_ops.c index a355cacc..b55b0d31 100644 --- a/apps/irssi/src/silc/core/client_ops.c +++ b/apps/irssi/src/silc/core/client_ops.c @@ -932,12 +932,18 @@ void silc_notify(SilcClient client, SilcClientConnection conn, for (i = 0; i < clients_count; i++) { memset(buf, 0, sizeof(buf)); - if (clients[i]->username) - snprintf(buf, sizeof(buf) - 1, "%s@%s", - clients[i]->username, clients[i]->hostname); - signal_emit("message quit", 4, server, clients[i]->nickname, - clients[i]->username ? buf : "", - "server signoff"); + + /* Print only if we have the nickname. If this client has just quit + when we were only resolving it, it is possible we don't have the + nickname. */ + if (clients[i]->nickname) { + if (clients[i]->username) + snprintf(buf, sizeof(buf) - 1, "%s@%s", + clients[i]->username, clients[i]->hostname); + signal_emit("message quit", 4, server, clients[i]->nickname, + clients[i]->username ? buf : "", + "server signoff"); + } silc_server_free_ftp(server, clients[i]);