mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-18 21:23:02 +00:00
Fix defects detected by Coverity Scan 2021.12.1: Declaring variable data without initializer
This commit is contained in:
parent
24a9781017
commit
0f65cbeb91
@ -33,11 +33,11 @@ boost::system::error_code Rtl_Tcp_Dongle_Info::read(boost::asio::ip::tcp::socket
|
|||||||
{
|
{
|
||||||
boost::system::error_code ec;
|
boost::system::error_code ec;
|
||||||
|
|
||||||
unsigned char data[sizeof(char) * 4 + sizeof(uint32_t) * 2];
|
std::vector<unsigned char> data(sizeof(char) * 4 + sizeof(uint32_t) * 2);
|
||||||
size_t received_bits = socket.receive(boost::asio::buffer(data), 0, ec);
|
size_t received_bits = socket.receive(boost::asio::buffer(data), 0, ec);
|
||||||
if (!ec && (received_bits > 0))
|
if (!ec && (received_bits > 0))
|
||||||
{
|
{
|
||||||
std::memcpy(magic_, data, 4);
|
std::memcpy(magic_, data.data(), 4);
|
||||||
|
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
std::memcpy(&type, &data[4], 4);
|
std::memcpy(&type, &data[4], 4);
|
||||||
|
Loading…
Reference in New Issue
Block a user