diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-11-13 04:03:52 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-11-13 04:03:52 +0000 |
commit | 662ae15ba418aab24e40b19da55e7e86a954a05c (patch) | |
tree | 2aaca5de91c70285b83d3f834fa16dff0c1be7ac /usr.bin | |
parent | 664fdd78880ff6a8e1d4acc23af1b230afb7a7c8 (diff) |
from netbsd:
Fix file descriptor leak.
Include header files to bring prototypes into scope. Remove explicit
declarations.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ul/ul.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/ul/ul.c b/usr.bin/ul/ul.c index 84190841e20..b806688ec04 100644 --- a/usr.bin/ul/ul.c +++ b/usr.bin/ul/ul.c @@ -47,6 +47,8 @@ static char rcsid[] = "$NetBSD: ul.c,v 1.3 1994/12/07 00:28:24 jtc Exp $"; #endif /* not lint */ #include <stdio.h> +#include <stdlib.h> +#include <string.h> #define IESC '\033' #define SO '\016' @@ -93,7 +95,6 @@ main(argc, argv) char *termtype; FILE *f; char termcap[1024]; - char *getenv(), *strcpy(); termtype = getenv("TERM"); if (termtype == NULL || (argv[0][0] == 'c' && !isatty(1))) @@ -142,8 +143,10 @@ main(argc, argv) if (f == NULL) { perror(argv[optind]); exit(1); - } else - filter(f); + } + + filter(f); + fclose(f); } exit(0); } |