From bf937e5e69d0d858f56cc6c87ee3731690435aaf Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sun, 20 May 2007 19:29:38 +0000 Subject: [PATCH] Fix recognition of realnames starting with spaces in /who replies. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4507 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/irc/fe-events-numeric.c | 4 ++-- src/irc/core/irc-nicklist.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fe-common/irc/fe-events-numeric.c b/src/fe-common/irc/fe-events-numeric.c index bf05f45f..c69a4238 100644 --- a/src/fe-common/irc/fe-events-numeric.c +++ b/src/fe-common/irc/fe-events-numeric.c @@ -115,8 +115,8 @@ static void event_who(IRC_SERVER_REC *server, const char *data) /* split hops/realname */ hops = realname; while (*realname != '\0' && *realname != ' ') realname++; - while (*realname == ' ') realname++; - if (realname > hops) realname[-1] = '\0'; + if (*realname == ' ') + *realname++ = '\0'; printformat(server, NULL, MSGLEVEL_CRAP, IRCTXT_WHO, channel, nick, stat, hops, user, host, realname, serv); diff --git a/src/irc/core/irc-nicklist.c b/src/irc/core/irc-nicklist.c index f736746a..b60056a8 100644 --- a/src/irc/core/irc-nicklist.c +++ b/src/irc/core/irc-nicklist.c @@ -212,8 +212,8 @@ static void event_who(SERVER_REC *server, const char *data) /* get hop count */ hops = realname; while (*realname != '\0' && *realname != ' ') realname++; - *realname++ = '\0'; - while (*realname == ' ') realname++; + if (*realname == ' ') + *realname++ = '\0'; /* update host, realname, hopcount */ chanrec = channel_find(server, channel);