From: Otto Date: Fri, 15 Jan 2021 14:59:06 +0000 (+0100) Subject: Some platforms actually have an unsigned msghdr.msg_iovlen even X-Git-Tag: dnsdist-1.6.0-alpha1~38^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F9979%2Fhead;p=thirdparty%2Fpdns.git Some platforms actually have an unsigned msghdr.msg_iovlen even though Posix says it should be an int. So use the power of C++ to make the var the same type as msghdr.msg_iovlen. --- diff --git a/pdns/calidns.cc b/pdns/calidns.cc index df93077981..e8dac6eb6d 100644 --- a/pdns/calidns.cc +++ b/pdns/calidns.cc @@ -108,7 +108,7 @@ static void* recvThread(const vector>* sockets) continue; } g_recvcounter++; - for (int i = 0; i < buf.msg_iovlen; i++) + for (decltype(buf.msg_iovlen) i = 0; i < buf.msg_iovlen; i++) g_recvbytes += buf.msg_iov[i].iov_len; #endif }