artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
527d7fd
)
Use ferror() to check for getline() failure. From Scott Cheloha.
author
millert
<millert@openbsd.org>
Wed, 31 May 2017 19:41:30 +0000
(19:41 +0000)
committer
millert
<millert@openbsd.org>
Wed, 31 May 2017 19:41:30 +0000
(19:41 +0000)
OK jung@
usr.bin/from/from.c
patch
|
blob
|
history
diff --git
a/usr.bin/from/from.c
b/usr.bin/from/from.c
index
52bf5e3
..
bd2bd69
100644
(file)
--- a/
usr.bin/from/from.c
+++ b/
usr.bin/from/from.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: from.c,v 1.2
4 2015/11/05 18:42:41 mmcc Exp $
*/
+/* $OpenBSD: from.c,v 1.2
5 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);
}