summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/from/from.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/from/from.c b/usr.bin/from/from.c
index 52bf5e3af03..bd2bd695801 100644
--- a/usr.bin/from/from.c
+++ b/usr.bin/from/from.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: from.c,v 1.24 2015/11/05 18:42:41 mmcc Exp $ */
+/* $OpenBSD: from.c,v 1.25 2017/05/31 19:41:30 millert Exp $ */
/* $NetBSD: from.c,v 1.6 1995/09/01 01:39:10 jtc Exp $ */
/*
@@ -98,6 +98,9 @@ main(int argc, char *argv[])
newline = 0;
}
free(line);
+ if (ferror(fp))
+ err(EXIT_FAILURE, "getline");
+ fclose(fp);
exit(EXIT_SUCCESS);
}