Useless feof: just use fgets.
authorMarkus Bröker <mbroeker@largo.dyndns.tv>
Sat, 05 Jun 2010 03:32:51 +0200
changeset 54 e21f837e2b13
parent 53 ec1eec96e433
child 55 02afddde7b94
Useless feof: just use fgets. committer: Markus Bröker <mbroeker@largo.homelinux.org>
src/main.c
--- a/src/main.c
+++ b/src/main.c
@@ -93,10 +93,7 @@
             fprintf (message.stream, "TOPIC %s :%s\r\n", uc.channel, uc.topic);
     }
 
-    while (!feof (message.stream)) {
-        if (fgets (buf, sizeof (buf), message.stream) == NULL)
-            break;
-
+    while (fgets (buf, sizeof (buf), message.stream) != NULL) {
         if (!active)            /* the bot was killed with SIGTERM */
             break;