-/*
- * $Id: snmp_core.cc,v 1.21 1998/12/02 05:51:00 wessels Exp $
+*
+ * $Id: snmp_core.cc,v 1.22 1998/12/02 05:57:52 wessels Exp $
*
* DEBUG: section 49 SNMP support
* AUTHOR: Glenn Chisholm
snmp_rq->len = len;
snmp_rq->sock = sock;
snmp_rq->outbuf = xmalloc(snmp_rq->outlen = SNMP_REQUEST_SIZE);
- memcpy(&snmp_rq->from, &from, sizeof(struct sockaddr_in));
+ xmemcpy(&snmp_rq->from, &from, sizeof(struct sockaddr_in));
snmpDecodePacket(snmp_rq);
xfree(snmp_rq);
} else {
debug(49, 5) ("snmpDecodePacket: Called.\n");
/* Now that we have the data, turn it into a PDU */
- Session = (struct snmp_session *) xmalloc(sizeof(struct snmp_session));
+ Session = xmalloc(sizeof(struct snmp_session));
Session->Version = SNMP_VERSION_1;
Session->authenticator = NULL;
Session->community = (u_char *) xstrdup("public");
}
/*
- * Allocate space for, and copy, an OID. Returns new oid, or NULL.
+ * Allocate space for, and copy, an OID. Returns new oid.
*/
oid *
snmpOidDup(oid * A, snint ALen)
{
- oid *Ans;
-
- Ans = (oid *) xmalloc(sizeof(oid) * ALen);
- if (Ans)
- memcpy(Ans, A, (sizeof(oid) * ALen));
- return (Ans);
+ oid *Ans = xmalloc(sizeof(oid) * ALen);
+ xmemcpy(Ans, A, (sizeof(oid) * ALen));
+ return Ans;
}
/*