From 38887df2021f4ae8a0912ad363e947aaad56aaab Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Fri, 8 Aug 2014 02:26:23 +0200
Subject: kike: fix client unregistration
---
src/kike.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/kike.c b/src/kike.c
index 75537d6..3202333 100644
--- a/src/kike.c
+++ b/src/kike.c
@@ -681,9 +681,10 @@ client_unregister (struct client *c, const char *reason)
struct str_map_iter iter;
str_map_iter_init (&iter, &c->ctx->channels);
- struct channel *chan;
- while ((chan = str_map_iter_next (&iter)))
+ struct channel *chan, *next = str_map_iter_next (&iter);
+ for (chan = next; chan; chan = next)
{
+ next = str_map_iter_next (&iter);
struct channel_user *user;
if (!(user = channel_get_user (chan, c)))
continue;
--
cgit v1.2.3-70-g09d2