1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-02-06 14:10:11 +00:00

Remove usage of deprecated bzero, replaced by memset

This commit is contained in:
Carles Fernandez 2019-08-13 13:48:17 +02:00
parent 6c5a4c4859
commit 1bfa866354
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -537,7 +537,7 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg)
if (file->fp == stdin) if (file->fp == stdin)
{ {
/* input from stdin */ /* input from stdin */
FD_ZERO(&rs); std::memset(&rs, 0, sizeof(fd_set));
FD_SET(0, &rs); FD_SET(0, &rs);
if (!select(1, &rs, nullptr, nullptr, &tv)) 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}; struct timeval tv = {0, 0};
fd_set rs; fd_set rs;
FD_ZERO(&rs); std::memset(&rs, 0, sizeof(fd_set));
FD_SET(sock, &rs); FD_SET(sock, &rs);
if (!select(sock + 1, &rs, nullptr, nullptr, &tv)) 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; return -1;
} }
FD_ZERO(&rs); std::memset(&rs, 0, sizeof(fd_set));
FD_SET(sock, &rs); FD_SET(sock, &rs);
ws = rs; ws = rs;
if (select(sock + 1, &rs, &ws, nullptr, &tv) == 0) 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}; struct timeval tv = {0, 0};
fd_set rs; fd_set rs;
FD_ZERO(&rs); std::memset(&rs, 0, sizeof(fd_set));
FD_SET(sock, &rs); FD_SET(sock, &rs);
if (!select(sock + 1, &rs, nullptr, nullptr, &tv)) 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}; struct timeval tv = {0, 0};
fd_set ws; fd_set ws;
FD_ZERO(&ws); std::memset(&ws, 0, sizeof(fd_set));
FD_SET(sock, &ws); FD_SET(sock, &ws);
if (!select(sock + 1, nullptr, &ws, nullptr, &tv)) if (!select(sock + 1, nullptr, &ws, nullptr, &tv))
{ {