From af9ee44d526f7e8c8d3616d3f38d7862b6525767 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 17 Oct 2016 12:44:09 +1030 Subject: [PATCH] sphinx: memset warning suppression workaround. Milan summit finalized some changes, so this will be reworked soon anyway. Signed-off-by: Rusty Russell --- daemon/sphinx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daemon/sphinx.c b/daemon/sphinx.c index 069f66314..725d0abde 100644 --- a/daemon/sphinx.c +++ b/daemon/sphinx.c @@ -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; }