sphinx: memset warning suppression workaround.

Milan summit finalized some changes, so this will be reworked
soon anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2016-10-17 12:44:09 +10:30
parent 02cb651748
commit af9ee44d52

View file

@ -401,7 +401,9 @@ struct onionpacket *create_onionpacket(
if (MESSAGE_SIZE > messagelen) {
memset(&packet->hoppayloads, 0, TOTAL_HOP_PAYLOAD_SIZE);
#if MESSAGE_SIZE != 0 /* Suppress GCC warning about 0-length memset */
memset(&packet->payload, 0xFF, MESSAGE_SIZE);
#endif
memcpy(&packet->payload, message, messagelen);
packet->payload[messagelen] = 0x7f;
}