← KD100

Increase crash handler buffers to 2048 bytes

1b43368ee044f0bb5469518fb3dee37ec177e780 · Claude · Jan 22, 2026 06:53

Further increased command buffer sizes in the DEBUG crash handler
to completely eliminate -Wformat-truncation warnings.

Changes:
- cmd buffer: 1536 → 2048 bytes (line 91)
- gdb_cmd buffer: 1536 → 2048 bytes (line 118)

This ensures sufficient space for exe_path (max 1023 bytes) plus
command text and pointer formatting, with comfortable margin.

Debug build now compiles with zero warnings under all strictness flags.

+2 −2 · 1 file changed

  • src/main.c +2 −2
diff --git a/src/main.c b/src/main.c
index 7bf56fe..5c08a48 100644
--- a/src/main.c
+++ b/src/main.c
@@ -88,7 +88,7 @@ void crash_handler(int sig) {
         fprintf(stderr, "  Runtime address: %p\n", array[i]);
         fprintf(stderr, "  File offset:     %p\n", file_offset);
 
-        char cmd[1536];
+        char cmd[2048];
         snprintf(cmd, sizeof(cmd), "addr2line -e '%s' -f -C -p %p 2>&1",
                 exe_path, file_offset);
 
@@ -115,7 +115,7 @@ void crash_handler(int sig) {
     }
 
     fprintf(stderr, "\n=== Using gdb to get line info ===\n");
-    char gdb_cmd[1536];
+    char gdb_cmd[2048];
     snprintf(gdb_cmd, sizeof(gdb_cmd),
             "gdb -q '%s' -ex 'info line *%p' -ex 'quit' 2>/dev/null | grep -E \"Line|at\"",
             exe_path, array[3]);