summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormaverikou <[email protected]>2023-12-28 21:09:49 +0200
committerGitHub <[email protected]>2023-12-28 20:09:49 +0100
commit7cfdf33ff03f2c453f4b525eca66c074cdfe299c (patch)
tree4945531b80e5731707935a81871346aac2fdf869 /src
parent43b4f90eb7b12bff4539a419663ebbfbf4f58503 (diff)
downloadraylib-7cfdf33ff03f2c453f4b525eca66c074cdfe299c.tar.gz
raylib-7cfdf33ff03f2c453f4b525eca66c074cdfe299c.zip
TextReplace const correctness (#3678)
* TextReplace const correctness * cleanup
Diffstat (limited to 'src')
-rw-r--r--src/raylib.h2
-rw-r--r--src/rtext.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/raylib.h b/src/raylib.h
index cd31da62..0e6ef23f 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -1472,7 +1472,7 @@ RLAPI bool TextIsEqual(const char *text1, const char *text2);
RLAPI unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending
RLAPI const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf() style)
RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string
-RLAPI char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!)
+RLAPI char *TextReplace(const char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!)
RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!)
RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter
RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings
diff --git a/src/rtext.c b/src/rtext.c
index 2a6aa127..104e302a 100644
--- a/src/rtext.c
+++ b/src/rtext.c
@@ -1514,7 +1514,7 @@ const char *TextSubtext(const char *text, int position, int length)
// Replace text string
// REQUIRES: strlen(), strstr(), strncpy(), strcpy()
// WARNING: Allocated memory must be manually freed
-char *TextReplace(char *text, const char *replace, const char *by)
+char *TextReplace(const char *text, const char *replace, const char *by)
{
// Sanity checks and initialization
if (!text || !replace || !by) return NULL;