From 3a26642882fcc67f9ac4d3be38bc51270424aea0 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Wed, 29 May 1996 23:24:19 +0000 Subject: [PATCH] changed bzero/bcmp/bcopy to memset/memcmp/memcpy git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@546 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/popper/pop_init.c | 6 ++++-- appl/telnet/libtelnet/encrypt.h | 2 +- lib/kafs/afssys.c | 18 +++++++++--------- lib/roken/iruserok.c | 2 +- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/appl/popper/pop_init.c b/appl/popper/pop_init.c index 639d1ce04..5ba90b9d2 100644 --- a/appl/popper/pop_init.c +++ b/appl/popper/pop_init.c @@ -75,7 +75,7 @@ pop_init(POP *p,int argcount,char **argmessage) char * trace_file_name; /* Initialize the POP parameter block */ - bzero ((char *)p,(int)sizeof(POP)); + memset (p,0, sizeof(POP)); /* Save my name in a global variable */ p->myname = argmessage[0]; @@ -184,7 +184,9 @@ pop_init(POP *p,int argcount,char **argmessage) /* Look for the client's IP address in the list returned for its name */ for (addrp=ch_again->h_addr_list; *addrp; ++addrp) - if (bcmp(*addrp,&(cs.sin_addr),sizeof(cs.sin_addr)) == 0) break; + if (memcmp(*addrp, &cs.sin_addr, sizeof(cs.sin_addr)) + == 0) + break; if (!*addrp) { pop_log (p,POP_PRIORITY, diff --git a/appl/telnet/libtelnet/encrypt.h b/appl/telnet/libtelnet/encrypt.h index 0dad2e2b5..0004741be 100644 --- a/appl/telnet/libtelnet/encrypt.h +++ b/appl/telnet/libtelnet/encrypt.h @@ -65,7 +65,7 @@ #define VALIDKEY(key) ( key[0] | key[1] | key[2] | key[3] | \ key[4] | key[5] | key[6] | key[7]) -#define SAMEKEY(k1, k2) (!bcmp((void *)k1, (void *)k2, sizeof(des_cblock))) +#define SAMEKEY(k1, k2) (!memcmp(k1, k2, sizeof(des_cblock))) typedef struct { short type; diff --git a/lib/kafs/afssys.c b/lib/kafs/afssys.c index 83d3893df..367592fe0 100644 --- a/lib/kafs/afssys.c +++ b/lib/kafs/afssys.c @@ -242,7 +242,7 @@ k_afsklog(char *cell, char *krealm) * Build a struct ClearToken */ ct.AuthHandle = c.kvno; - bcopy((char *)c.session, ct.HandShakeKey, sizeof(c.session)); + memcpy (ct.HandShakeKey, c.session, sizeof(c.session)); ct.ViceId = getuid(); /* is this always valid? */ ct.BeginTimestamp = 1 + c.issue_date; ct.EndTimestamp = krb_life_to_time(c.issue_date, c.lifetime); @@ -252,30 +252,30 @@ k_afsklog(char *cell, char *krealm) * length of secret token followed by secret token */ sizeof_x = c.ticket_st.length; - bcopy((char *)&sizeof_x, t, sizeof(sizeof_x)); + memcpy(t, &sizeof_x, sizeof(sizeof_x)); t += sizeof(sizeof_x); - bcopy((char *)c.ticket_st.dat, t, sizeof_x); + memcpy(t, c.ticket_st.dat, sizeof_x); t += sizeof_x; /* * length of clear token followed by clear token */ sizeof_x = sizeof(ct); - bcopy((char *)&sizeof_x, t, sizeof(sizeof_x)); + memcpy(t, &sizeof_x, sizeof(sizeof_x)); t += sizeof(sizeof_x); - bcopy((char *)&ct, t, sizeof_x); + memcpy(t, &ct, sizeof_x); t += sizeof_x; /* * do *not* mark as primary cell */ sizeof_x = 0; - bcopy((char *)&sizeof_x, t, sizeof(sizeof_x)); + memcpy(t, &sizeof_x, sizeof(sizeof_x)); t += sizeof(sizeof_x); /* * follow with cell name */ sizeof_x = strlen(cell) + 1; - bcopy(cell, t, sizeof_x); + memcpy(t, cell, sizeof_x); t += sizeof_x; /* @@ -336,7 +336,7 @@ int k_unlog(void) { struct ViceIoctl parms; - bzero((char *)&parms, sizeof(parms)); + memset(&parms, 0, sizeof(parms)); return k_pioctl(0, VIOCUNLOG, &parms, 0); } @@ -397,7 +397,7 @@ k_hasafs(void) * If the syscall is absent we recive a SIGSYS. */ afs_entry_point = NO_ENTRY_POINT; - bzero(&parms, sizeof(parms)); + memset(&parms, 0, sizeof(parms)); saved_errno = errno; saved_func = signal(SIGSYS, SIGSYS_handler); diff --git a/lib/roken/iruserok.c b/lib/roken/iruserok.c index c3548701e..a85d781dd 100644 --- a/lib/roken/iruserok.c +++ b/lib/roken/iruserok.c @@ -61,7 +61,7 @@ __icheckhost(u_int32_t raddr, const char *lhost) /* Spin through ip addresses. */ for (pp = hp->h_addr_list; *pp; ++pp) - if (!bcmp(&raddr, *pp, sizeof(u_long))) + if (memcmp(&raddr, *pp, sizeof(u_long)) == 0) return (1); /* No match. */