From f307934129e4f5310cbd89ec739d47b0e031951f Mon Sep 17 00:00:00 2001 From: cbdev Date: Thu, 1 Mar 2018 17:58:10 +0100 Subject: Fix short memcpy --- sacn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sacn.c b/sacn.c index 822f178..417fc32 100644 --- a/sacn.c +++ b/sacn.c @@ -517,7 +517,7 @@ static void sacn_discovery(size_t fd){ pdu.data.flags = htobe16(0x7000 | (8 + universes * sizeof(uint16_t))); pdu.data.page = page; - memcpy(pdu.data.data, global_cfg.fd[fd].universe + page * 512, universes); + memcpy(pdu.data.data, global_cfg.fd[fd].universe + page * 512, universes * sizeof(uint16_t)); if(sendto(global_cfg.fd[fd].fd, &pdu, sizeof(pdu) - (512 - universes) * sizeof(uint16_t), 0, (struct sockaddr*) &discovery_dest, sizeof(discovery_dest)) < 0){ fprintf(stderr, "Failed to output sACN universe discovery frame for interface %zu: %s\n", fd, strerror(errno)); -- cgit v1.2.3