From 994e7207f84d7c18e0d78484d431df93d973e83e Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 17 Nov 2013 23:54:44 +0100 Subject: [PATCH] udp_recv: Fix clang warning. clang does not seem to like adding to a string literal: udp_recv.c:51:45: warning: adding 'size_t' (aka 'unsigned long') to a string does not append to the string [-Wstring-plus-int] if (memcmp(iov[1].iov_base, FEC_EOF_PACKET + iov[0].iov_len, ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ udp_recv.c:51:45: note: use array indexing to silence this warning That's kind of silly, but if this simple change makes clang happy, so be it. --- udp_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udp_recv.c b/udp_recv.c index 436b298c..1648cad8 100644 --- a/udp_recv.c +++ b/udp_recv.c @@ -43,7 +43,7 @@ static int udp_check_eof(size_t sz, struct iovec iov[2]) } if (memcmp(iov[0].iov_base, FEC_EOF_PACKET, iov[0].iov_len) != 0) return 0; - if (memcmp(iov[1].iov_base, FEC_EOF_PACKET + iov[0].iov_len, + if (memcmp(iov[1].iov_base, &FEC_EOF_PACKET[iov[0].iov_len], FEC_EOF_PACKET_LEN - iov[0].iov_len) != 0) return 0; return -E_RECV_EOF; -- 2.39.5