From 57faf310db4c7d7d07a5695fb305c481e040e4fb Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Thu, 16 May 2019 22:09:57 +0100 Subject: Improve "listchannels" stdin debugging command. --- blabouncer.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/blabouncer.c b/blabouncer.c index 41e0a47..7d2ea31 100644 --- a/blabouncer.c +++ b/blabouncer.c @@ -1259,6 +1259,17 @@ void dochat(int *serversockfd, int *clientsockfd, struct settings *settings) { } printf("Found channel '%s'.\n", channels[i].name); + // Store count of names so we can increment it in the loop if we encounter gaps in the names array + int namescount = getchannelnamescount(channels, channels[i].name); + // Go through each name... + for (int j = 0; j < namescount; j++) { + if (!channels[i].nicks[j][0]) { + // Skip this one and increment namescount so we find it later on instead + namescount++; + continue; + } + printf(" --> '%s' '%s' '%s'.\n", channels[i].namestype, channels[i].name, channels[i].nicks[j]); + } } printf("STDIN command complete: listchannels\n"); -- cgit v1.2.3