changed bzero/bcmp/bcopy to memset/memcmp/memcpy

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@546 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1996-05-29 23:24:19 +00:00
parent 7434b7feef
commit 3a26642882
4 changed files with 15 additions and 13 deletions

View File

@@ -75,7 +75,7 @@ pop_init(POP *p,int argcount,char **argmessage)
char * trace_file_name; char * trace_file_name;
/* Initialize the POP parameter block */ /* Initialize the POP parameter block */
bzero ((char *)p,(int)sizeof(POP)); memset (p,0, sizeof(POP));
/* Save my name in a global variable */ /* Save my name in a global variable */
p->myname = argmessage[0]; 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 /* Look for the client's IP address in the list returned
for its name */ for its name */
for (addrp=ch_again->h_addr_list; *addrp; ++addrp) 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) { if (!*addrp) {
pop_log (p,POP_PRIORITY, pop_log (p,POP_PRIORITY,

View File

@@ -65,7 +65,7 @@
#define VALIDKEY(key) ( key[0] | key[1] | key[2] | key[3] | \ #define VALIDKEY(key) ( key[0] | key[1] | key[2] | key[3] | \
key[4] | key[5] | key[6] | key[7]) 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 { typedef struct {
short type; short type;

View File

@@ -242,7 +242,7 @@ k_afsklog(char *cell, char *krealm)
* Build a struct ClearToken * Build a struct ClearToken
*/ */
ct.AuthHandle = c.kvno; 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.ViceId = getuid(); /* is this always valid? */
ct.BeginTimestamp = 1 + c.issue_date; ct.BeginTimestamp = 1 + c.issue_date;
ct.EndTimestamp = krb_life_to_time(c.issue_date, c.lifetime); 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 * length of secret token followed by secret token
*/ */
sizeof_x = c.ticket_st.length; 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); t += sizeof(sizeof_x);
bcopy((char *)c.ticket_st.dat, t, sizeof_x); memcpy(t, c.ticket_st.dat, sizeof_x);
t += sizeof_x; t += sizeof_x;
/* /*
* length of clear token followed by clear token * length of clear token followed by clear token
*/ */
sizeof_x = sizeof(ct); sizeof_x = sizeof(ct);
bcopy((char *)&sizeof_x, t, sizeof(sizeof_x)); memcpy(t, &sizeof_x, sizeof(sizeof_x));
t += sizeof(sizeof_x); t += sizeof(sizeof_x);
bcopy((char *)&ct, t, sizeof_x); memcpy(t, &ct, sizeof_x);
t += sizeof_x; t += sizeof_x;
/* /*
* do *not* mark as primary cell * do *not* mark as primary cell
*/ */
sizeof_x = 0; sizeof_x = 0;
bcopy((char *)&sizeof_x, t, sizeof(sizeof_x)); memcpy(t, &sizeof_x, sizeof(sizeof_x));
t += sizeof(sizeof_x); t += sizeof(sizeof_x);
/* /*
* follow with cell name * follow with cell name
*/ */
sizeof_x = strlen(cell) + 1; sizeof_x = strlen(cell) + 1;
bcopy(cell, t, sizeof_x); memcpy(t, cell, sizeof_x);
t += sizeof_x; t += sizeof_x;
/* /*
@@ -336,7 +336,7 @@ int
k_unlog(void) k_unlog(void)
{ {
struct ViceIoctl parms; struct ViceIoctl parms;
bzero((char *)&parms, sizeof(parms)); memset(&parms, 0, sizeof(parms));
return k_pioctl(0, VIOCUNLOG, &parms, 0); return k_pioctl(0, VIOCUNLOG, &parms, 0);
} }
@@ -397,7 +397,7 @@ k_hasafs(void)
* If the syscall is absent we recive a SIGSYS. * If the syscall is absent we recive a SIGSYS.
*/ */
afs_entry_point = NO_ENTRY_POINT; afs_entry_point = NO_ENTRY_POINT;
bzero(&parms, sizeof(parms)); memset(&parms, 0, sizeof(parms));
saved_errno = errno; saved_errno = errno;
saved_func = signal(SIGSYS, SIGSYS_handler); saved_func = signal(SIGSYS, SIGSYS_handler);

View File

@@ -61,7 +61,7 @@ __icheckhost(u_int32_t raddr, const char *lhost)
/* Spin through ip addresses. */ /* Spin through ip addresses. */
for (pp = hp->h_addr_list; *pp; ++pp) 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); return (1);
/* No match. */ /* No match. */