From 88103ca7f4c342d0e239b411f3321b0d25c0a150 Mon Sep 17 00:00:00 2001 From: Roger Meier Date: Fri, 6 Dec 2013 20:47:39 +0100 Subject: [PATCH] THRIFT-2040 "uninitialized variable" warnings on MSVC/windows Patch: Konrad Grochowski --- lib/cpp/src/thrift/transport/TBufferTransports.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cpp/src/thrift/transport/TBufferTransports.cpp b/lib/cpp/src/thrift/transport/TBufferTransports.cpp index a307748b..d819868a 100644 --- a/lib/cpp/src/thrift/transport/TBufferTransports.cpp +++ b/lib/cpp/src/thrift/transport/TBufferTransports.cpp @@ -175,7 +175,7 @@ bool TFramedTransport::readFrame() { // We can't use readAll(&sz, sizeof(sz)), since that always throws an // exception on EOF. We want to throw an exception only if EOF occurs after // partial size data. - int32_t sz; + int32_t sz = -1; uint32_t size_bytes_read = 0; while (size_bytes_read < sizeof(sz)) { uint8_t* szp = reinterpret_cast(&sz) + size_bytes_read; -- 2.17.1