--- a/src/main.c
+++ b/src/main.c
@@ -92,7 +92,8 @@
}
while (!feof (message.stream)) {
- fgets (buf, sizeof (buf), message.stream);
+ if (fgets (buf, sizeof (buf), message.stream) == NULL)
+ break;
if (!active) /* the bot was killed with SIGTERM */
break;