From a5a0f1a8a11e4a67edbb0191d12508c3226248ea Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 3 Feb 2025 12:46:23 -0500 Subject: [PATCH] Update main.c check pos before getc --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 524abd32..9e47c212 100644 --- a/main.c +++ b/main.c @@ -2336,7 +2336,7 @@ void get_tlm_fc() { // FunCube Mode telemetry generation int value; if (image_file != NULL) { printf("Writing image data to payload\n"); - while (((value = getc(image_file)) != EOF) && (pos < 256)) { + while ((pos < 256) && ((value = getc(image_file)) != EOF)) { source_bytes[pos++] = value; printf("%2x ", value); }