Skip to content
Snippets Groups Projects
Commit d74fafdc authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix wrong buf size argument in FILE_SIZE code

Caught by Coverity: CID 529977:  Incorrect expression  (SIZEOF_MISMATCH)
parent 57d4c080
Branches
Tags
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment