Skip to content

Commit 7a65315

Browse files
committed
fix: resolve -Wmaybe-uninitialized warnings
1 parent b208018 commit 7a65315

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util/wpipe.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void WakeupPipe::Drain() const
6464
assert(m_valid && m_pipe[0] != -1);
6565

6666
int ret{0};
67-
std::array<uint8_t, 128> buf;
67+
std::array<uint8_t, 128> buf{};
6868
do {
6969
ret = read(m_pipe[0], buf.data(), buf.size());
7070
} while (ret > 0);
@@ -78,7 +78,7 @@ void WakeupPipe::Write()
7878
#ifdef USE_WAKEUP_PIPE
7979
assert(m_valid && m_pipe[1] != -1);
8080

81-
std::array<uint8_t, EXPECTED_PIPE_WRITTEN_BYTES> buf;
81+
std::array<uint8_t, EXPECTED_PIPE_WRITTEN_BYTES> buf{};
8282
int ret = write(m_pipe[1], buf.data(), buf.size());
8383
if (ret == -1) {
8484
LogPrintf("write() to m_pipe[1] = %d failed with error %s\n", m_pipe[1], NetworkErrorString(WSAGetLastError()));

0 commit comments

Comments
 (0)