diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-11-13 19:16:10 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-11-13 19:16:10 +0000 |
commit | 9f5ff11c4e25dbd494e84457d5d6eaf82efebe84 (patch) | |
tree | 2da33f991038c4b2dc66ffe0d75d8c6dbf24d6f4 /sbin/scsi | |
parent | 28bf3cd257481a2a6e496c1456b0edf976bec9c4 (diff) |
missing fclose(); dhill@mindcry.org
Diffstat (limited to 'sbin/scsi')
-rw-r--r-- | sbin/scsi/scsi.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/scsi/scsi.c b/sbin/scsi/scsi.c index 14d3c409f4e..fb0919f1a8e 100644 --- a/sbin/scsi/scsi.c +++ b/sbin/scsi/scsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi.c,v 1.19 2005/04/13 02:33:08 deraadt Exp $ */ +/* $OpenBSD: scsi.c,v 1.20 2005/11/13 19:16:09 deraadt Exp $ */ /* $FreeBSD: scsi.c,v 1.11 1996/04/06 11:00:28 joerg Exp $ */ /* @@ -549,7 +549,7 @@ static char *mode_lookup(int page) mode_db = new_db; modes = fopen(mode_db, "r"); - if (modes == 0) + if (modes == NULL) return 0; next = 0; @@ -587,7 +587,8 @@ static char *mode_lookup(int page) } if (found && c != '\n') { if (next >= sizeof(fmt)) { - fprintf(stderr, "Stupid program: Buffer overflow.\n"); + fprintf(stderr, + "Stupid program: Buffer overflow.\n"); exit(ENOMEM); } @@ -595,6 +596,7 @@ static char *mode_lookup(int page) } } } + fclose(modes); fmt[next] = 0; return (found) ? fmt : 0; |