From 1bfa8663543edfcf468c74f86cf687970aeb0c21 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 13 Aug 2019 13:48:17 +0200 Subject: [PATCH] Remove usage of deprecated bzero, replaced by memset --- src/algorithms/libs/rtklib/rtklib_stream.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index 8ab4b87a5..a7c209ae0 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -537,7 +537,7 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg) if (file->fp == stdin) { /* input from stdin */ - FD_ZERO(&rs); + std::memset(&rs, 0, sizeof(fd_set)); FD_SET(0, &rs); if (!select(1, &rs, nullptr, nullptr, &tv)) { @@ -844,7 +844,7 @@ socket_t accept_nb(socket_t sock, struct sockaddr *addr, socklen_t *len) { struct timeval tv = {0, 0}; fd_set rs; - FD_ZERO(&rs); + std::memset(&rs, 0, sizeof(fd_set)); FD_SET(sock, &rs); if (!select(sock + 1, &rs, nullptr, nullptr, &tv)) { @@ -875,7 +875,7 @@ int connect_nb(socket_t sock, struct sockaddr *addr, socklen_t len) { return -1; } - FD_ZERO(&rs); + std::memset(&rs, 0, sizeof(fd_set)); FD_SET(sock, &rs); ws = rs; if (select(sock + 1, &rs, &ws, nullptr, &tv) == 0) @@ -892,7 +892,7 @@ int recv_nb(socket_t sock, unsigned char *buff, int n) { struct timeval tv = {0, 0}; fd_set rs; - FD_ZERO(&rs); + std::memset(&rs, 0, sizeof(fd_set)); FD_SET(sock, &rs); if (!select(sock + 1, &rs, nullptr, nullptr, &tv)) { @@ -907,7 +907,7 @@ int send_nb(socket_t sock, unsigned char *buff, int n) { struct timeval tv = {0, 0}; fd_set ws; - FD_ZERO(&ws); + std::memset(&ws, 0, sizeof(fd_set)); FD_SET(sock, &ws); if (!select(sock + 1, nullptr, &ws, nullptr, &tv)) {