SNMP octet scring has a defined length and does not need a null separator
This commit is contained in:
parent
4138f390d4
commit
891b0b0c9e
1 changed files with 4 additions and 3 deletions
|
|
@ -917,11 +917,12 @@ type_xml2snmp(char *snmpstr,
|
|||
break;
|
||||
}
|
||||
case ASN_OCTET_STR: // 4
|
||||
*snmplen = strlen(snmpstr)+1;
|
||||
if ((*snmpval = (u_char*)strdup((snmpstr))) == NULL){
|
||||
clixon_err(OE_UNIX, errno, "strdup");
|
||||
*snmplen = strlen(snmpstr);
|
||||
if ((*snmpval = malloc(*snmplen)) == NULL){
|
||||
clixon_err(OE_UNIX, errno, "malloc");
|
||||
goto done;
|
||||
}
|
||||
memcpy(*snmpval, snmpstr, *snmplen);
|
||||
break;
|
||||
case ASN_COUNTER64:{ // 0x46 / 70
|
||||
uint64_t u64;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue