mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 10:46:58 +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:
parent
02cb651748
commit
af9ee44d52
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue