From af82f4e9ac5b6c5685518f6687d32a26c2f9c5a4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 19 Nov 2023 17:16:59 -0500 Subject: [PATCH] Update main.c command_count fix --- main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 044d6ff7..b0e12675 100644 --- a/main.c +++ b/main.c @@ -1575,9 +1575,10 @@ void get_tlm_fox() { char count_string[10]; if ( (fgets(count_string, 10, command_count_file)) != NULL) groundCommandCount = atoi(count_string); + fclose(command_count_file); } else printf("Error opening command_count.txt!\n"); - fclose(command_count_file); + printf("Command count: %d\n", groundCommandCount); int status = STEMBoardFailure + SafeMode * 2 + sim_mode * 4 + PayloadFailure1 * 8 +