--- a/src/config.c
+++ b/src/config.c
@@ -46,7 +46,8 @@
uc->port = 6667;
while (!feof (f)) {
- (void)fgets (buffer, sizeof (buffer), f);
+ if (fgets (buffer, sizeof (buffer), f) == NULL)
+ break;
token = buffer;
while (*token == '\t') /* Eat trailing tabs */