From 3af46997ab393a5e41556a7207f5bb52aeb00c8c Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Sun, 4 Aug 2024 15:22:58 -0500 Subject: [PATCH] test_msg: remove redundant packet buffer initialization The _encode function always zeros the buffer up to _MAX_SIZE bytes so there is no need to do it beforehand. Avoids encouraging poor habits. --- templates/test_msg.cpp.em | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/test_msg.cpp.em b/templates/test_msg.cpp.em index 4490da7..32a526f 100644 --- a/templates/test_msg.cpp.em +++ b/templates/test_msg.cpp.em @@ -89,7 +89,7 @@ int main() { // Create a UAVCAN message @(msg_underscored_name) _msg = sample_@(msg_underscored_name)_msg(); - uint8_t buffer[@(msg_define_name.upper())_MAX_SIZE] {}; + uint8_t buffer[@(msg_define_name.upper())_MAX_SIZE]; // encode the message uint32_t data_len = @(msg_underscored_name)_encode(&_msg, buffer);