From d74fafdc1d79edfb68af70f20d05575807634587 Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on Windows 11)" <rob@synchro.net>
Date: Wed, 8 Jan 2025 11:54:01 -0800
Subject: [PATCH] Fix wrong buf size argument in FILE_SIZE code

Caught by Coverity: CID 529977:  Incorrect expression  (SIZEOF_MISMATCH)
---
 src/sbbs3/atcodes.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sbbs3/atcodes.cpp b/src/sbbs3/atcodes.cpp
index 7c06bde224..23305b0428 100644
--- a/src/sbbs3/atcodes.cpp
+++ b/src/sbbs3/atcodes.cpp
@@ -2308,7 +2308,7 @@ const char* sbbs_t::atcode(const char* sp, char* str, size_t maxlen, int* pmode,
 			return str;
 		}
 		if(strcmp(sp, "FILE_SIZE") == 0)
-			return byte_estimate_to_str(current_file->size, str, sizeof str, /* units: */1024, /* precision: */1);
+			return byte_estimate_to_str(current_file->size, str, maxlen, /* units: */1024, /* precision: */1);
 		if(strcmp(sp, "FILE_CREDITS") == 0) {
 			safe_snprintf(str, maxlen, "%" PRIu64, current_file->cost);
 			return str;
-- 
GitLab