Increase crash handler buffers to 2048 bytes
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
@@ -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]);