added gnutls backend and moved backend code into new files
[ircu2.10.12-pk.git] / ircd / m_names.c
index 8b9509fbcc783ef875fd59966c51daff259fd180..157b7ee5abc33f7b362cdda3ad722467c183fb3b 100644 (file)
@@ -179,14 +179,6 @@ void do_names(struct Client* sptr, struct Channel* chptr, int filter)
       /* space, modifier, nick, \r \n \0 */
     {
       send_reply(sptr, (filter & NAMES_DEL) ? RPL_DELNAMREPLY : RPL_NAMREPLY, buf);
-      strcpy(buf, "* ");
-      ircd_strncpy(buf + 2, chptr->chname, len + 1);
-      buf[len + 2] = ':';
-      buf[len + 3] = '\0';
-      if (PubChannel(chptr))
-        *buf = '=';
-      else if (SecretChannel(chptr))
-        *buf = '@';
       idx = len + 4;
       flag = 0;
       needs_space=0;
@@ -293,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;
@@ -300,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)