From 944567651ca7e3f43ff758a1326da481bc9d07a7 Mon Sep 17 00:00:00 2001 From: Connor O'Connor Date: Tue, 2 Dec 2025 16:49:55 -0500 Subject: [PATCH] replace sprintf with snprintf (#5382) --- src/rcore.c | 2 +- src/rtext.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index 58ff963e6..3a9a47359 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -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 diff --git a/src/rtext.c b/src/rtext.c index 37f4eaafa..c17fbe9bf 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -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