Replaced deprecated BSD against ANSI functions (bzero -> memset, bcopy

-> memcopy)
This commit is contained in:
Stefan Wahren
2012-05-18 13:55:43 +02:00
parent 11f6392df3
commit b055dc612f
4 changed files with 10 additions and 10 deletions

View File

@ -57,7 +57,7 @@ mbus_serial_connect(char *device)
return NULL;
}
bzero(&(handle->t), sizeof(handle->t));
memset(&(handle->t), 0, sizeof(handle->t));
handle->t.c_cflag |= (CS8|CREAD|CLOCAL);
handle->t.c_cflag |= PARENB;
@ -228,7 +228,7 @@ mbus_serial_recv_frame(mbus_serial_handle *handle, mbus_frame *frame)
if (handle == NULL || frame == NULL)
return -1;
bzero((void *)buff, sizeof(buff));
memset((void *)buff, 0, sizeof(buff));
//
// read data until a packet is received

View File

@ -78,7 +78,7 @@ mbus_tcp_connect(char *host, int port)
return NULL;
}
bcopy((void *)(host_addr->h_addr), (void *)(&s.sin_addr), host_addr->h_length);
memcpy((void *)(&s.sin_addr), (void *)(host_addr->h_addr), host_addr->h_length);
if (connect(handle->sock, (struct sockaddr *)&s, sizeof(s)) < 0)
{
@ -169,7 +169,7 @@ mbus_tcp_recv_frame(mbus_tcp_handle *handle, mbus_frame *frame)
if (handle == NULL || frame == NULL)
return -1;
bzero((void *)buff, sizeof(buff));
memset((void *)buff, 0, sizeof(buff));
//
// read data until a packet is received