From 1ed65ee9f4b923ab3cf322471ca1a3eff9ea1307 Mon Sep 17 00:00:00 2001 From: Dicot0721 <149964080+Dicot0721@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:05:19 +0800 Subject: [PATCH] fix: Initialize the local variable properly. - Make sure `pollfd::revents` is initialized. --- public/common/TracySocket.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/common/TracySocket.cpp b/public/common/TracySocket.cpp index bdba3619..0d724148 100644 --- a/public/common/TracySocket.cpp +++ b/public/common/TracySocket.cpp @@ -515,9 +515,11 @@ Socket* ListenSocket::Accept() struct sockaddr_storage remote; socklen_t sz = sizeof( remote ); - struct pollfd fd; - fd.fd = (socket_t)m_sock; - fd.events = POLLIN; + struct pollfd fd + { + .fd = (socket_t)m_sock, + .events = POLLIN + }; if( poll( &fd, 1, 10 ) > 0 ) {