logger: avoid logging the padding if it's at the end of a message format

This commit is contained in:
Beat Küng
2016-05-20 10:20:40 +02:00
committed by Lorenz Meier
parent bd96afa00b
commit a9930c2173
+1 -2
View File
@@ -527,8 +527,7 @@ void Logger::run()
for (LoggerSubscription &sub : _subscriptions) {
/* each message consists of a header followed by an orb data object
*/
size_t msg_size = sizeof(message_data_header_s) + sub.metadata->o_size;
//TODO: use sub.metadata->o_size_no_padding
size_t msg_size = sizeof(message_data_header_s) + sub.metadata->o_size_no_padding;
uint8_t buffer[msg_size];
/* if this topic has been updated, copy the new data into the message buffer