aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/kike.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/kike.c b/src/kike.c
index 1b218c9..07ebccd 100644
--- a/src/kike.c
+++ b/src/kike.c
@@ -638,16 +638,16 @@ irc_handle_nick (const struct irc_message *msg, struct client *c)
irc_send_reply (c, IRC_ERR_ERRONEOUSNICKNAME, nickname);
return;
}
- if (str_map_find (&ctx->users, nickname))
- {
- irc_send_reply (c, IRC_ERR_NICKNAMEINUSE, nickname);
- return;
- }
if (c->nickname)
{
str_map_set (&ctx->users, c->nickname, NULL);
free (c->nickname);
}
+ if (str_map_find (&ctx->users, nickname))
+ {
+ irc_send_reply (c, IRC_ERR_NICKNAMEINUSE, nickname);
+ return;
+ }
// Allocate the nickname
c->nickname = xstrdup (nickname);