From 5afe65cfc5a34fd1a09bdd1aae29f3d62f5de77a Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Thu, 28 Nov 2024 07:09:06 +0100 Subject: Added missing fclose() --- FICS/makerank.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'FICS') diff --git a/FICS/makerank.c b/FICS/makerank.c index 70fe7ea..5f1f2f5 100644 --- a/FICS/makerank.c +++ b/FICS/makerank.c @@ -39,8 +39,11 @@ GetPlayerInfo(char *fileName, ENTRY *e) if ((fp = fopen(fileName, "r")) == NULL || fgets(line, sizeof line, fp) == NULL || - feof(fp)) + feof(fp)) { + if (fp) + fclose(fp); return 0; + } if (!strcmp(line, "v 1\n")) { fgets(line, sizeof line, fp); -- cgit v1.2.3