replace sprintf with snprintf

This commit is contained in:
Connor O'Connor 2025-12-02 12:37:50 -05:00
parent 3ba186f2c1
commit ccaaa6242e
2 changed files with 2 additions and 2 deletions

View File

@ -4313,7 +4313,7 @@ const char *TextFormat(const char *text, ...)
{
// Inserting "..." at the end of the string to mark as truncated
char *truncBuffer = buffers[index] + MAX_TEXT_BUFFER_LENGTH - 4; // Adding 4 bytes = "...\0"
sprintf(truncBuffer, "...");
snprintf(truncBuffer, 4, "...");
}
index += 1; // Move to next buffer for next function call

View File

@ -1529,7 +1529,7 @@ const char *TextFormat(const char *text, ...)
{
// Inserting "..." at the end of the string to mark as truncated
char *truncBuffer = buffers[index] + MAX_TEXT_BUFFER_LENGTH - 4; // Adding 4 bytes = "...\0"
sprintf(truncBuffer, "...");
snprintf(truncBuffer, 4, "...");
}
index += 1; // Move to next buffer for next function call