register unsigned char *cp = NULL;
register int i;
- bzero (sa, len);
+ memset (sa, 0, len);
if (VECTORP (address))
{
/* This is broken, at least in the Linux 2.4 kernel.
To unbind, the arg must be a zero integer, not the empty string.
This should work on all systems. KFS. 2003-09-23. */
- bzero (devname, sizeof devname);
+ memset (devname, 0, sizeof devname);
if (STRINGP (val))
{
char *arg = (char *) SDATA (val);
int len = min (strlen (arg), IFNAMSIZ);
- bcopy (arg, devname, len);
+ memcpy (devname, arg, len);
}
else if (!NILP (val))
error ("Bad option value for %s", name);
host = Qnil;
}
CHECK_STRING (service);
- bzero (&address_un, sizeof address_un);
+ memset (&address_un, 0, sizeof address_un);
address_un.sun_family = AF_LOCAL;
strncpy (address_un.sun_path, SDATA (service), sizeof address_un.sun_path);
ai.ai_addr = (struct sockaddr *) &address_un;
port = svc_info->s_port;
}
- bzero (&address_in, sizeof address_in);
+ memset (&address_in, 0, sizeof address_in);
address_in.sin_family = family;
address_in.sin_addr.s_addr = INADDR_ANY;
address_in.sin_port = port;
if (host_info_ptr)
{
- bcopy (host_info_ptr->h_addr, (char *) &address_in.sin_addr,
- host_info_ptr->h_length);
+ memcpy (&address_in.sin_addr, host_info_ptr->h_addr,
+ host_info_ptr->h_length);
family = host_info_ptr->h_addrtype;
address_in.sin_family = family;
}
if (numeric_addr == -1)
error ("Unknown host \"%s\"", SDATA (host));
- bcopy ((char *)&numeric_addr, (char *) &address_in.sin_addr,
- sizeof (address_in.sin_addr));
+ memcpy (&address_in.sin_addr, &numeric_addr,
+ sizeof (address_in.sin_addr));
}
}
if (is_server)
{
Lisp_Object remote;
- bzero (datagram_address[s].sa, lres->ai_addrlen);
+ memset (datagram_address[s].sa, 0, lres->ai_addrlen);
if (remote = Fplist_get (contact, QCremote), !NILP (remote))
{
int rfamily, rlen;
}
}
else
- bcopy (lres->ai_addr, datagram_address[s].sa, lres->ai_addrlen);
+ memcpy (datagram_address[s].sa, lres->ai_addr, lres->ai_addrlen);
}
#endif
contact = Fplist_put (contact, QCaddress,
char namebuf[sizeof (ifq->ifr_name) + 1];
if (ifq->ifr_addr.sa_family != AF_INET)
continue;
- bcopy (ifq->ifr_name, namebuf, sizeof (ifq->ifr_name));
+ memcpy (namebuf, ifq->ifr_name, sizeof (ifq->ifr_name));
namebuf[sizeof (ifq->ifr_name)] = 0;
res = Fcons (Fcons (build_string (namebuf),
conv_sockaddr_to_lisp (&ifq->ifr_addr,
CHECK_STRING (ifname);
- bzero (rq.ifr_name, sizeof rq.ifr_name);
+ memset (rq.ifr_name, 0, sizeof rq.ifr_name);
strncpy (rq.ifr_name, SDATA (ifname), sizeof (rq.ifr_name));
s = socket (AF_INET, SOCK_STREAM, 0);
chars = (char *) alloca (carryover + readmax);
if (carryover)
/* See the comment above. */
- bcopy (SDATA (p->decoding_buf), chars, carryover);
+ memcpy (chars, SDATA (p->decoding_buf), carryover);
#ifdef DATAGRAM_SOCKETS
/* We have a working select, so proc_buffered_char is always -1. */
{
if (SCHARS (p->decoding_buf) < coding->carryover_bytes)
p->decoding_buf = make_uninit_string (coding->carryover_bytes);
- bcopy (coding->carryover, SDATA (p->decoding_buf),
- coding->carryover_bytes);
+ memcpy (SDATA (p->decoding_buf), coding->carryover,
+ coding->carryover_bytes);
p->decoding_carryover = coding->carryover_bytes;
}
if (SBYTES (text) > 0)
{
if (SCHARS (p->decoding_buf) < coding->carryover_bytes)
p->decoding_buf = make_uninit_string (coding->carryover_bytes);
- bcopy (coding->carryover, SDATA (p->decoding_buf),
- coding->carryover_bytes);
+ memcpy (SDATA (p->decoding_buf), coding->carryover,
+ coding->carryover_bytes);
p->decoding_carryover = coding->carryover_bytes;
}
/* Adjust the multibyteness of TEXT to that of the buffer. */
if (!proc_encode_coding_system[new_outfd])
proc_encode_coding_system[new_outfd]
= (struct coding_system *) xmalloc (sizeof (struct coding_system));
- bcopy (proc_encode_coding_system[old_outfd],
- proc_encode_coding_system[new_outfd],
- sizeof (struct coding_system));
- bzero (proc_encode_coding_system[old_outfd],
- sizeof (struct coding_system));
+ memcpy (proc_encode_coding_system[new_outfd],
+ proc_encode_coding_system[old_outfd],
+ sizeof (struct coding_system));
+ memset (proc_encode_coding_system[old_outfd], 0,
+ sizeof (struct coding_system));
XPROCESS (proc)->outfd = new_outfd;
}
chan_process[i] = Qnil;
proc_buffered_char[i] = -1;
}
- bzero (proc_decode_coding_system, sizeof proc_decode_coding_system);
- bzero (proc_encode_coding_system, sizeof proc_encode_coding_system);
+ memset (proc_decode_coding_system, 0, sizeof proc_decode_coding_system);
+ memset (proc_encode_coding_system, 0, sizeof proc_encode_coding_system);
#ifdef DATAGRAM_SOCKETS
- bzero (datagram_address, sizeof datagram_address);
+ memset (datagram_address, 0, sizeof datagram_address);
#endif
#ifdef HAVE_SOCKETS