fclose() open FILE * even though we are returning to fail anyway.
silences coverity, CID 1590 / run 5
This commit is contained in:
parent
a46f31170d
commit
969e2244d4
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: word.c,v 1.8 2005/07/01 16:38:24 jmc Exp $ */
|
||||
/* $NetBSD: word.c,v 1.9 2006/03/18 09:40:46 rtr Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993
|
||||
|
@ -37,7 +37,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)word.c 8.1 (Berkeley) 6/11/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: word.c,v 1.8 2005/07/01 16:38:24 jmc Exp $");
|
||||
__RCSID("$NetBSD: word.c,v 1.9 2006/03/18 09:40:46 rtr Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -193,21 +193,23 @@ loadindex(const char *indexfile)
|
|||
while (fgets(buf, sizeof(buf), fp) != NULL) {
|
||||
if (strchr(buf, '\n') == NULL) {
|
||||
warnx("A line in the index file is too long");
|
||||
(void) fclose(fp);
|
||||
return(-1);
|
||||
}
|
||||
j = *buf - 'a';
|
||||
if (i != j) {
|
||||
warnx("Bad index order");
|
||||
(void) fclose(fp);
|
||||
return(-1);
|
||||
}
|
||||
dictindex[j].start = atol(buf + 1);
|
||||
dictindex[j].length = atol(buf + 9) - dictindex[j].start;
|
||||
i++;
|
||||
}
|
||||
(void) fclose(fp);
|
||||
if (i != 26) {
|
||||
warnx("Bad index length");
|
||||
return(-1);
|
||||
}
|
||||
(void) fclose(fp);
|
||||
return(0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue