src/irc.c
changeset 11 a769385a59c6
parent 10 311ea5fa60dd
child 12 213c3d4abc66
--- a/src/irc.c
+++ b/src/irc.c
@@ -25,6 +25,7 @@
     "NOTICE", "MODE", "JOIN", "PART",
     "TOPIC", "PING", "ENOMEM", "ERROR",
     "VERSION", "PRIVMSG", "QUIT", "NICK",
+    NULL
 };
 
 FILE *irc_connect (char *server, unsigned int port)
@@ -103,7 +104,7 @@
     fprintf (stream, "PRIVMSG NICKSERV :IDENTIFY %s\r\n", password);
 
     for (;;) {
-        *msg = 0;
+        *msg = '\0';
         fgets (msg, 512, stream);
         if ((user = irc_parsemessage (msg, &message)) != NULL)
             printf ("%10s %s\n", user, message.line);
@@ -231,13 +232,13 @@
                     return command;
                 case 8:        /* VERSION */
                     if ((ptr = strchr (message->user, ' ')))
-                        *ptr = 0;
+                        *ptr = '\0';
                     return command;
                 case 9:        /* PRIVMSG */
                     if ((message->email = strchr (message->user, '=')))
                         ++message->email;
                     if ((ptr = strchr (message->user, '!')))
-                        *ptr = 0;
+                        *ptr = '\0';
 
                     message->channel = strtok (message->line, " ");
                     message->current_channel = message->channel;
@@ -314,7 +315,6 @@
             case 375:
             case 376:          /* END OF MOTD */
                 return command;
-                break;
             case 401:          /* NO SUCH NICK/CHANNEL */
             case 403:          /* THAT CHANNEL DOESN'T EXIST */
             case 441:          /* THEY AREN'T ON THIS CHANNEL */