From a2b984d4f1968d8ee3d4987433f4d20eb20b0ee8 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Mon, 16 Dec 2002 18:43:33 +0000 Subject: [PATCH] Do not print the nickname on SERVER_SIGNOFF if we do not have it. Fixes asserts in Irssi Core. --- apps/irssi/src/silc/core/client_ops.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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]); -- 2.43.0