diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,11 @@
 
 h-raylib's version numbers do not follow the usual format. The first two numbers in the version track the underlying C raylib version. For example, `5.1.x.x` versions use raylib 5.1 under the hood. The third number represents breaking changes (renamed/deleted functions or modules). The last number represents non-breaking changes (new functions or modules, bug fixes, etc). The safest version bound format to use is `h-raylib >=x.y.z.w && <x.y.(z+1)` (instead of the usual `^>=` bound).
 
+## Version 5.5.3.1
+_14 October 2025_
+
+- Fixed a bug with `setTraceLogCallback` not working properly
+
 ## Version 5.5.3.0
 _14 August 2025_
 
diff --git a/default.nix b/default.nix
--- a/default.nix
+++ b/default.nix
@@ -3,7 +3,7 @@
 }:
 mkDerivation {
   pname = "h-raylib";
-  version = "5.5.3.0";
+  version = "5.5.3.1";
   src = ./.;
   isLibrary = true;
   isExecutable = buildExamples;
diff --git a/h-raylib.cabal b/h-raylib.cabal
--- a/h-raylib.cabal
+++ b/h-raylib.cabal
@@ -1,6 +1,6 @@
 cabal-version:      2.4
 name:               h-raylib
-version:            5.5.3.0
+version:            5.5.3.1
 synopsis:           Raylib bindings for Haskell
 category:           graphics
 description:
diff --git a/lib/rl_bindings.c b/lib/rl_bindings.c
--- a/lib/rl_bindings.c
+++ b/lib/rl_bindings.c
@@ -2382,8 +2382,20 @@
 
 void CustomCallback(int logLevel, const char *text, va_list args)
 {
-    char *formatted = TextFormat(text, args);
+    va_list args_copy;
+    va_copy(args_copy, args);
+
+    int len = vsnprintf(NULL, 0, text, args_copy);
+    va_end(args_copy);
+
+    if (len < 0) return;
+
+    char *formatted = malloc(len + 1);
+
+    vsnprintf(formatted, len + 1, text, args);
     customCallback(logLevel, formatted);
+
+    free(formatted);
 }
 
 RLBIND void SetTraceLogCallback_(TraceLogCallback_ a)
