Fix SF bug #2895252 by changing the trailing space to a nul character.
authorMichael Poole <mdpoole@troilus.org>
Sun, 3 Jan 2010 21:20:56 +0000 (21:20 +0000)
committerMichael Poole <mdpoole@troilus.org>
Sun, 3 Jan 2010 21:20:56 +0000 (21:20 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1929 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/m_names.c

index b1bbe6bd4b8652338c9e7fc3877e88ad77e9ed8f..d6a54796d80b2d4471e9eaeef8b9aed3c36de8cd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-03  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/m_names.c (m_names): Terminate the buffer used for listing
+       clients who are not in any channel.
+
 2010-01-03  Michael Poole <mdpoole@troilus.org>
 
        * ircd/channel.c (find_delayed_joins): Move earlier in the file.
index 6c84d5079b8bae2e4655e90c55a67e8fce5f5e91..157b7ee5abc33f7b362cdda3ad722467c183fb3b 100644 (file)
@@ -285,6 +285,7 @@ int m_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
         if (mlen + idx + NICKLEN + 3 > BUFSIZE)     /* space, \r\n\0 */
         {
+          buf[idx-1] = '\0';
           send_reply(sptr, RPL_NAMREPLY, buf);
           strcpy(buf, "* * :");
           idx = 5;
@@ -292,7 +293,10 @@ int m_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
         }
       }
       if (flag)
+      {
+        buf[idx-1] = '\0';
         send_reply(sptr, RPL_NAMREPLY, buf);
+      }
       send_reply(sptr, RPL_ENDOFNAMES, "*");
     }
     else if ((chptr = FindChannel(para)) != NULL)