diff options
| author | Ray <[email protected]> | 2023-10-11 20:25:09 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2023-10-11 20:25:09 +0200 |
| commit | 876e6b3a0d4db8e6124bf8f95d048879f2f760b1 (patch) | |
| tree | a74614358da5485850900020e4afb9110e1fb263 /src/rtext.c | |
| parent | 6ed8acde6730c34a7e127b16ab567a5f3438b29b (diff) | |
| download | raylib-876e6b3a0d4db8e6124bf8f95d048879f2f760b1.tar.gz raylib-876e6b3a0d4db8e6124bf8f95d048879f2f760b1.zip | |
REVIEWED: `TextFormat()`, added "..." for truncation #3366
It seems more standard than [TRUN]
Diffstat (limited to 'src/rtext.c')
| -rw-r--r-- | src/rtext.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rtext.c b/src/rtext.c index 593fdb53..2d72bbe6 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1377,9 +1377,9 @@ const char *TextFormat(const char *text, ...) // If requiredByteCount is larger than the MAX_TEXT_BUFFER_LENGTH, then overflow occured if (requiredByteCount >= MAX_TEXT_BUFFER_LENGTH) { - // We are going to insert [TRUN] at the end of the string so the user knows what happened - char *truncBuffer = buffers[index] + MAX_TEXT_BUFFER_LENGTH - 7; // Adding 7 bytes = six chars + '\0' - sprintf(truncBuffer, "[TRUN]"); + // 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, "..."); } index += 1; // Move to next buffer for next function call |
