Don't leak files.
This also eliminates the need for ifp init. Submitted by: ru@
This commit is contained in:
parent
5fd6a6b362
commit
a4ae1f8999
@ -182,7 +182,7 @@ makefile(void)
|
||||
void
|
||||
makehints(void)
|
||||
{
|
||||
FILE *ifp = NULL, *ofp;
|
||||
FILE *ifp, *ofp;
|
||||
char line[BUFSIZ];
|
||||
char *s;
|
||||
struct hint *hint;
|
||||
@ -228,10 +228,9 @@ makehints(void)
|
||||
continue;
|
||||
fprintf(ofp, "\"%s\\0\"\n", line);
|
||||
}
|
||||
fclose(ifp);
|
||||
}
|
||||
fprintf(ofp, "\"\\0\"\n};\n");
|
||||
if (ifp)
|
||||
fclose(ifp);
|
||||
fclose(ofp);
|
||||
moveifchanged(path("hints.c.new"), path("hints.c"));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user