Increase node_log buffer to fix -Wformat-truncation warnings
The node_log macro used a 256-byte buffer for formatting log details, but bucket names (64B) and keys (512B) can together require up to ~606 bytes, causing gcc to emit format-truncation warnings. Increase the buffer to 1024 bytes to accommodate the worst case. https://claude.ai/code/session_01HXKM6UjE3G4A29zTc7gFxo
This commit is contained in:
+1
-1
@@ -64,7 +64,7 @@ static void node_log_impl(ServerState *state, const char *event, const char *det
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define node_log(state, event, fmt, ...) do { \
|
#define node_log(state, event, fmt, ...) do { \
|
||||||
char _detail[256]; \
|
char _detail[1024]; \
|
||||||
snprintf(_detail, sizeof(_detail), fmt, ##__VA_ARGS__); \
|
snprintf(_detail, sizeof(_detail), fmt, ##__VA_ARGS__); \
|
||||||
node_log_impl(state, event, _detail); \
|
node_log_impl(state, event, _detail); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|||||||
Reference in New Issue
Block a user