summaryrefslogtreecommitdiff
path: root/3
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2020-12-03 17:11:01 +0100
committerBond_009 <bond.009@outlook.com>2020-12-03 17:11:01 +0100
commit3da231113ccdd1b777028a4990dd035d07facdd5 (patch)
tree1d40c291bfbb7ce493302b251c829777d69b2328 /3
parent1b5677661fd8bd513d6f81ba6e19e1a23498d3cf (diff)
fclose files
Diffstat (limited to '3')
-rw-r--r--3/part1.c2
-rw-r--r--3/part2.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/3/part1.c b/3/part1.c
index 19f3bf3..c71ce0a 100644
--- a/3/part1.c
+++ b/3/part1.c
@@ -26,6 +26,8 @@ int count_trees(const char * filename)
pos = (pos + INC_RIGHT) % width;
}
+ fclose(file);
+
return hit;
}
diff --git a/3/part2.c b/3/part2.c
index d7c4ce9..8bcdcfd 100644
--- a/3/part2.c
+++ b/3/part2.c
@@ -29,6 +29,8 @@ int count_trees(int inc_right, int inc_down, const char * filename)
pos = (pos + inc_right) % width;
}
+ fclose(file);
+
return hit;
}