src/main.c
changeset 29 08ec6ddd6eea
parent 23 1cd79bb84e9c
child 31 bbcb8a3366b4
equal deleted inserted replaced
28:ef929533d040 29:08ec6ddd6eea
    97         if (!active)            /* the bot was killed with SIGTERM */
    97         if (!active)            /* the bot was killed with SIGTERM */
    98             break;
    98             break;
    99 
    99 
   100         if ((command = irc_parsemessage (buf, &message))) {
   100         if ((command = irc_parsemessage (buf, &message))) {
   101             printf ("%10s %s %s\n", command, message.channel, message.line);
   101             printf ("%10s %s %s\n", command, message.channel, message.line);
   102             if (!strcmp (command, "ERROR") || !strcmp (command, "ENOMEM"))
   102             if (!strcmp (command, "ERROR") || !strcmp (command, "ENOMEM")) {
   103                 break;
   103                 break;
       
   104             }
   104         } else {
   105         } else {
   105             if ((msg = parse (&message)) != NULL) {
   106             if ((msg = parse (&message)) != NULL) {
   106                 fprintf (message.stream, "%s\r\n", msg);
   107                 fprintf (message.stream, "%s\r\n", msg);
   107                 printf ("%10s %s", "WRITE", msg);
   108                 printf ("%10s %s", "WRITE", msg);
   108             }
   109             }