mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 16:44:20 +01:00
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:
@@ -401,7 +401,9 @@ struct onionpacket *create_onionpacket(
|
|||||||
|
|
||||||
if (MESSAGE_SIZE > messagelen) {
|
if (MESSAGE_SIZE > messagelen) {
|
||||||
memset(&packet->hoppayloads, 0, TOTAL_HOP_PAYLOAD_SIZE);
|
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);
|
memset(&packet->payload, 0xFF, MESSAGE_SIZE);
|
||||||
|
#endif
|
||||||
memcpy(&packet->payload, message, messagelen);
|
memcpy(&packet->payload, message, messagelen);
|
||||||
packet->payload[messagelen] = 0x7f;
|
packet->payload[messagelen] = 0x7f;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user