mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-20 21:35:34 +00:00
replace sprintf with snprintf (#5382)
This commit is contained in:
@@ -4313,7 +4313,7 @@ const char *TextFormat(const char *text, ...)
|
|||||||
{
|
{
|
||||||
// Inserting "..." at the end of the string to mark as truncated
|
// Inserting "..." at the end of the string to mark as truncated
|
||||||
char *truncBuffer = buffers[index] + MAX_TEXT_BUFFER_LENGTH - 4; // Adding 4 bytes = "...\0"
|
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
|
index += 1; // Move to next buffer for next function call
|
||||||
|
|||||||
@@ -1529,7 +1529,7 @@ const char *TextFormat(const char *text, ...)
|
|||||||
{
|
{
|
||||||
// Inserting "..." at the end of the string to mark as truncated
|
// Inserting "..." at the end of the string to mark as truncated
|
||||||
char *truncBuffer = buffers[index] + MAX_TEXT_BUFFER_LENGTH - 4; // Adding 4 bytes = "...\0"
|
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
|
index += 1; // Move to next buffer for next function call
|
||||||
|
|||||||
Reference in New Issue
Block a user