While this is harmless, we prefer to know that each byte is correctly
initialized to avoid Valgrind warnings.
*output_buffer = new;
}
- struct hmsg_header hdr = {
- .type = type,
- .len = len
- };
+ struct hmsg_header hdr;
+ memset(&hdr, 0, sizeof(struct hmsg_header));
+ hdr.type = type;
+ hdr.len = len;
memcpy(*output_buffer + *output_len, &hdr, sizeof(struct hmsg_header));
if (t)
memcpy(*output_buffer + *output_len + sizeof(struct hmsg_header), buffer, len);