Skip to content

Commit

Permalink
Remove some references to bcopy/bcmp/bzero.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roland McGrath committed Jan 13, 2015
1 parent 8bedcb5 commit 1c6e6f2
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2015-01-13 Roland McGrath <roland@hack.frob.com>

* login/logout.c (logout): Use memset rather than bzero.
* nis/nss_compat/compat-pwd.c (getpwent_next_file): Likewise.
* nis/nss_compat/compat-spwd.c (getspent_next_file): Likewise.
* resolv/gethnamaddr.c (gethostbyaddr): Use memcmp rather than bcmp.
(_gethtbyaddr): Likewise.
* locale/programs/simple-hash.c (bcopy): Macro removed.

2015-01-13 Adhemerval Zanella <azanella@linux.vnet.ibm.com>

* sysdeps/powerpc/powerpc64/multiarch/Makefile [sysdep_routines]:
Expand Down
4 changes: 0 additions & 4 deletions locale/programs/simple-hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@
# define BITSPERBYTE 8
#endif

#ifndef bcopy
# define bcopy(s, d, n) memcpy ((d), (s), (n))
#endif

#define hashval_t uint32_t
#include "hashval.h"

Expand Down
4 changes: 2 additions & 2 deletions login/logout.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ logout (const char *line)
if (getutline_r (&tmp, &utbuf, &ut) >= 0)
{
/* Clear information about who & from where. */
bzero (ut->ut_name, sizeof ut->ut_name);
memset (ut->ut_name, '\0', sizeof ut->ut_name);
#if _HAVE_UT_HOST - 0
bzero (ut->ut_host, sizeof ut->ut_host);
memset (ut->ut_host, '\0', sizeof ut->ut_host);
#endif
#if _HAVE_UT_TV - 0
struct timeval tv;
Expand Down
2 changes: 1 addition & 1 deletion nis/nss_compat/compat-pwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ getpwent_next_file (struct passwd *result, ent_t *ent,
char *user, *host, *domain;
struct __netgrent netgrdata;

bzero (&netgrdata, sizeof (struct __netgrent));
memset (&netgrdata, 0, sizeof (struct __netgrent));
__internal_setnetgrent (&result->pw_name[2], &netgrdata);
while (__internal_getnetgrent_r (&host, &user, &domain, &netgrdata,
buf2, sizeof (buf2), errnop))
Expand Down
2 changes: 1 addition & 1 deletion nis/nss_compat/compat-spwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ getspent_next_file (struct spwd *result, ent_t *ent,
char *user, *host, *domain;
struct __netgrent netgrdata;

bzero (&netgrdata, sizeof (struct __netgrent));
memset (&netgrdata, 0, sizeof (struct __netgrent));
__internal_setnetgrent (&result->sp_namp[2], &netgrdata);
while (__internal_getnetgrent_r (&host, &user, &domain,
&netgrdata, buf2, sizeof (buf2),
Expand Down
6 changes: 3 additions & 3 deletions resolv/gethnamaddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,8 @@ gethostbyaddr(addr, len, af)
return (NULL);
}
if (af == AF_INET6 && len == IN6ADDRSZ &&
(!bcmp(uaddr, mapped, sizeof mapped) ||
!bcmp(uaddr, tunnelled, sizeof tunnelled))) {
(!memcmp(uaddr, mapped, sizeof mapped) ||
!memcmp(uaddr, tunnelled, sizeof tunnelled))) {
/* Unmap. */
addr += sizeof mapped;
uaddr += sizeof mapped;
Expand Down Expand Up @@ -922,7 +922,7 @@ _gethtbyaddr(addr, len, af)

_sethtent(0);
while ((p = _gethtent()))
if (p->h_addrtype == af && !bcmp(p->h_addr, addr, len))
if (p->h_addrtype == af && !memcmp(p->h_addr, addr, len))
break;
_endhtent();
return (p);
Expand Down

0 comments on commit 1c6e6f2

Please sign in to comment.