summaryrefslogtreecommitdiff
path: root/5/part2_fast.c
diff options
context:
space:
mode:
Diffstat (limited to '5/part2_fast.c')
-rw-r--r--5/part2_fast.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/5/part2_fast.c b/5/part2_fast.c
index df2a585..9c4753e 100644
--- a/5/part2_fast.c
+++ b/5/part2_fast.c
@@ -59,13 +59,11 @@ int missing_seat_id(const char *filename)
int max = 0;
while (fgets(buffer, 16, file)) {
int tmp = seat_id(buffer);
- if (tmp > max)
- {
+ if (tmp > max) {
max = tmp;
}
- if (tmp < min)
- {
+ if (tmp < min) {
min = tmp;
}
@@ -78,6 +76,8 @@ int missing_seat_id(const char *filename)
}
}
+ fclose(file);
+
return 0;
}