com_err(whoami,errno," socket");
exit(1);
}
- bzero((char *)&sin,(int)sizeof(sin));
+ memset(&sin, 0, sizeof(sin));
sin.sin_family = AF_INET;
sin.sin_port = sp->s_port;
U_32BIT vers = htonl((U_32BIT)CUR_UREG_VERSION);
cl_status = htonl((U_32BIT)cl_status);
/* Put current user registration protocol version into the packet */
- bcopy((char *)&vers, packet, sizeof(U_32BIT));
+ memcpy(packet, &vers, sizeof(U_32BIT));
/* Put sequence number into the packet */
- bcopy((char *)&seqno, packet+sizeof(U_32BIT), sizeof(U_32BIT));
+ memcpy(packet+sizeof(U_32BIT), &seqno, sizeof(U_32BIT));
/* Put error status into the packet */
- bcopy((char *)&cl_status, packet+ 2*sizeof(U_32BIT), sizeof(U_32BIT));
+ memcpy(packet+ 2*sizeof(U_32BIT), &cl_status, sizeof(U_32BIT));
/* Find out how much of the message to copy; truncate if too short. */
/* How much room is there left? */
if (status == SUCCESS)
{
/* Extract the user registration protocol version from the packet */
- bcopy(packet, (char *)&message->version, sizeof(long));
+ memcpy(&message->version, packet, sizeof(long));
/* Convert byte order from network to host */
message->version = ntohl(message->version);
/* Verify version */
if (status == SUCCESS)
{
/* Extract the sequence number from the packet */
- bcopy(packet, (char *)&CUR_REQ.seqno, sizeof(long));
+ memcpy(&CUR_REQ.seqno, packet, sizeof(long));
packet += sizeof(U_32BIT);
pktlen -= sizeof(U_32BIT);
if (status == SUCCESS)
{
/* Extract the request from the packet */
- bcopy(packet, (char *)(&message->request), sizeof(U_32BIT));
+ memcpy(&message->request, packet, sizeof(U_32BIT));
message->request = ntohl(message->request);
packet += sizeof(U_32BIT);
pktlen -= sizeof(U_32BIT);