diff --git a/usr.bin/lam/lam.c b/usr.bin/lam/lam.c --- a/usr.bin/lam/lam.c +++ b/usr.bin/lam/lam.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #define MAXOFILES 20 @@ -212,6 +213,9 @@ *p = '\0'; if (c == EOF) { ip->eof = 1; + if (ferror(ip->fp)) { + err(EX_IOERR, NULL); + } if (ip->fp == stdin) fclose(stdin); morefiles--;