SDL: assert: Allow messages of any length.

From ca26df34044bc66e0744442723f84e8b0c0d4cfb Mon Sep 17 00:00:00 2001
From: Eddy Jansson <[EMAIL REDACTED]>
Date: Fri, 29 Apr 2022 16:44:32 +0200
Subject: [PATCH] assert: Allow messages of any length.

Messages are no longer truncated to SDL_MAX_LOG_MESSAGE.
---
 src/SDL_assert.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/SDL_assert.c b/src/SDL_assert.c
index 8f2e95093c7..d4e4dd1561c 100644
--- a/src/SDL_assert.c
+++ b/src/SDL_assert.c
@@ -179,9 +179,9 @@ SDL_PromptAssertion(const SDL_assert_data *data, void *userdata)
                 data->trigger_count, (data->trigger_count == 1) ? "time" : "times",
                 data->condition);
 
-        /* .. and if it didn't, allocate a bigger buffer and try again */
+        /* .. and if it didn't, allocate as much room as we actually need. */
         if (len >= buf_len && message == stack_buf) {
-            buf_len = SDL_MAX_LOG_MESSAGE;
+            buf_len = len + 1;
             message = (char *)SDL_malloc(buf_len);
             if (!message) {
                 /* Uh oh, we're in real trouble now... */