summaryrefslogtreecommitdiff
path: root/myrbuild
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2013-06-05 11:13:44 -0400
committerOri Bernstein <ori@eigenstate.org>2013-06-05 11:13:44 -0400
commit61bf93a04f438f9ff1273a996b7d8030b1547259 (patch)
tree3b77a0c67def335a1abcb4fefe9bc7f9a85c2aeb /myrbuild
parent4a0be740af3f660508516835969ee345836ca6ec (diff)
downloadmc-61bf93a04f438f9ff1273a996b7d8030b1547259.tar.gz
Remember to close the file when reading deps.
Diffstat (limited to 'myrbuild')
-rw-r--r--myrbuild/myrbuild.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/myrbuild/myrbuild.c b/myrbuild/myrbuild.c
index 2aacc01..c486e75 100644
--- a/myrbuild/myrbuild.c
+++ b/myrbuild/myrbuild.c
@@ -165,7 +165,7 @@ void getdeps(char *file, char **deps, size_t depsz, size_t *ndeps)
f = fopen(file, "r");
if (!f)
- err(1, "Could not open file %s", file);
+ err(1, "Could not open file \"%s\"", file);
i = 0;
while (fgets(buf, sizeof buf, f)) {
@@ -179,6 +179,7 @@ void getdeps(char *file, char **deps, size_t depsz, size_t *ndeps)
else
free(dep);
}
+ fclose(f);
*ndeps = i;
}