src/main.c
changeset 54 e21f837e2b13
parent 49 59b09b0aeb96
equal deleted inserted replaced
53:ec1eec96e433 54:e21f837e2b13
    91         safe_strncpy (message.current_channel, uc.channel, sizeof (message.current_channel));
    91         safe_strncpy (message.current_channel, uc.channel, sizeof (message.current_channel));
    92         if (uc.topic)
    92         if (uc.topic)
    93             fprintf (message.stream, "TOPIC %s :%s\r\n", uc.channel, uc.topic);
    93             fprintf (message.stream, "TOPIC %s :%s\r\n", uc.channel, uc.topic);
    94     }
    94     }
    95 
    95 
    96     while (!feof (message.stream)) {
    96     while (fgets (buf, sizeof (buf), message.stream) != NULL) {
    97         if (fgets (buf, sizeof (buf), message.stream) == NULL)
       
    98             break;
       
    99 
       
   100         if (!active)            /* the bot was killed with SIGTERM */
    97         if (!active)            /* the bot was killed with SIGTERM */
   101             break;
    98             break;
   102 
    99 
   103         if ((command = irc_parsemessage (buf, &message))) {
   100         if ((command = irc_parsemessage (buf, &message))) {
   104             if (!strcmp (command, "ERROR") || !strcmp (command, "ENOMEM"))
   101             if (!strcmp (command, "ERROR") || !strcmp (command, "ENOMEM"))